Skip to content

Commit

Permalink
fix persist not getting initialized properly (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pistonight authored Dec 27, 2024
1 parent 246c271 commit 9d02cf3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/pure/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pistonite/pure",
"version": "0.0.15",
"version": "0.0.16",
"description": "Pure TypeScript libraries for my projects",
"homepage": "https://github.com/Pistonite/pure",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion packages/pure/src/sync/persist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ class PersistImpl<T> implements Persist<T> {
const loadedValue = deserialize(data);
if (loadedValue !== null) {
value = loadedValue;
this.cell.set(value);
}
}
} catch {}
this.cell.set(value);
this.unsubscribe = this.cell.subscribe((value) => {
this.storage.setItem(this.key, serialize(value));
});
Expand Down

0 comments on commit 9d02cf3

Please sign in to comment.