chore: bump version (#2249)
This commit is contained in:
1 parent
1ef408c9ad
commit
496225a92e
16 files changed
+643
-633
No files matched your search
@@ -4,13 +4,13 @@
|
||||
"main": "./src/index.ts",
|
||||
"dependencies": {
|
||||
"@affine/env": "workspace:*",
|
||||
"jotai": "^2.0.4"
|
||||
"jotai": "^2.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/blocks": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230503040956-5c49643f-nightly",
|
||||
"@blocksuite/blocks": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/editor": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/global": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"@blocksuite/store": "0.0.0-20230505225643-03f75e5e-nightly",
|
||||
"lottie-web": "^5.11.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -15,16 +15,16 @@ type SetStateActionWithReset<Value> =
|
||||
// similar to atomWithStorage, but will not trigger twice on init
|
||||
// https://github.com/pmndrs/jotai/discussions/1737
|
||||
export function atomWithSyncStorage<Value>(key: string, initialValue: Value) {
|
||||
const storedValue = storage.getItem(key) as Value;
|
||||
const storedValue = storage.getItem(key, initialValue) as Value;
|
||||
const _value =
|
||||
typeof storedValue === 'symbol'
|
||||
? initialValue
|
||||
: (storage.getItem(key) as Value);
|
||||
: (storage.getItem(key, initialValue) as Value);
|
||||
const baseAtom = atom(_value);
|
||||
|
||||
baseAtom.onMount = setAtom => {
|
||||
if (storage.subscribe) {
|
||||
return storage.subscribe(key, setAtom);
|
||||
return storage.subscribe(key, setAtom, initialValue);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user