bloc-react
Advanced tools
Comparing version
@@ -218,6 +218,6 @@ 'use strict'; | ||
removeLocalBloc(id, bloc) { | ||
const item = this.providerList.find((i) => i.id !== id); | ||
const item = this.providerList.find((i) => i.id === id && i.bloc === bloc); | ||
if (item) { | ||
item.bloc.complete(); | ||
this.providerList = this.providerList.filter((e) => !(e.id !== item.id && e.bloc === bloc)); | ||
this.providerList = this.providerList.filter((i) => i !== item); | ||
} | ||
@@ -291,5 +291,5 @@ } | ||
const localProviderKey = React.useContext(this._contextLocalProviderKey); | ||
const localBlocInstance = this.getLocalBlocForProvider(localProviderKey, blocClass); | ||
const localBlocInstance = React.useMemo(() => this.getLocalBlocForProvider(localProviderKey, blocClass), []); | ||
const { subscribe, shouldUpdate = true } = mergedOptions; | ||
const blocInstance = localBlocInstance || this.getBlocInstance(this._blocsGlobal, blocClass); | ||
const blocInstance = React.useMemo(() => localBlocInstance || this.getBlocInstance(this._blocsGlobal, blocClass), []); | ||
if (!blocInstance) { | ||
@@ -296,0 +296,0 @@ const name = blocClass.prototype.constructor.name; |
{ | ||
"name": "bloc-react", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "dist/bloc-react.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
84843
0.2%