diff --git a/package.json b/package.json index 8d2b4c5..d053aa6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "global-state-hook", - "version": "1.5.0", + "version": "1.5.1", "description": "Super tiny state sharing library with hooks", "source": "src/index.ts", "main": "dist/index.js", diff --git a/src/index.ts b/src/index.ts index 447b0f4..fb51d2f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,7 +18,7 @@ export function createSubscription( const subscribe = (fn: Listener) => listener.push(fn) const unsubscribe = (fn: Listener) => (listener = listener.filter((f) => f !== fn)) - const updateState = (nextState: S, forceUpdate = false) => { + const updateState = (nextState: S, forceUpdate = true) => { Object.assign(state, nextState) forceUpdate && listener.forEach((fn) => fn(nextState)) }