Skip to content

Commit dd3f8b9

Browse files
committed
Fix persisted values not mounting on init
1 parent f61e4e5 commit dd3f8b9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/plexus-core/src/state.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ export class StateInstance<StateValue> extends WatchableMutable<StateValue> {
171171
if (name) this._internalStore._name = `state_${name}`
172172

173173
if (this.instance().storage) {
174+
this._internalStore._persist = true
175+
this.persistSync()
176+
174177
// Bandaid
175178
;(async () => {
176179
// this should only run on initial load of the state when this function is called

0 commit comments

Comments
 (0)