effector-storage 6.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -15
- package/async-storage/index.cjs.d.ts +1 -1
- package/async-storage/index.d.ts +1 -1
- package/async-storage/index.js.flow +1 -1
- package/core/index.cjs.d.ts +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js.flow +1 -1
- package/index.cjs.d.ts +2 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +2 -1
- package/index.js.flow +2 -1
- package/index.js.map +1 -1
- package/local/index.cjs.d.ts +10 -5
- package/local/index.cjs.map +1 -1
- package/local/index.d.ts +10 -5
- package/local/index.js.flow +14 -5
- package/local/index.js.map +1 -1
- package/log/index.cjs.d.ts +1 -1
- package/log/index.d.ts +1 -1
- package/log/index.js.flow +1 -1
- package/memory/index.cjs.d.ts +12 -7
- package/memory/index.cjs.map +1 -1
- package/memory/index.d.ts +12 -7
- package/memory/index.js.flow +19 -10
- package/memory/index.js.map +1 -1
- package/nil/index.cjs.d.ts +1 -1
- package/nil/index.d.ts +1 -1
- package/nil/index.js.flow +1 -1
- package/package.json +1 -1
- package/query/index.cjs.d.ts +10 -5
- package/query/index.cjs.map +1 -1
- package/query/index.d.ts +10 -5
- package/query/index.js.flow +14 -5
- package/query/index.js.map +1 -1
- package/rn/async/index.cjs.d.ts +10 -5
- package/rn/async/index.cjs.map +1 -1
- package/rn/async/index.d.ts +10 -5
- package/rn/async/index.js.flow +14 -5
- package/rn/async/index.js.map +1 -1
- package/rn/encrypted/index.cjs.d.ts +15 -5
- package/rn/encrypted/index.cjs.map +1 -1
- package/rn/encrypted/index.d.ts +15 -5
- package/rn/encrypted/index.js.flow +19 -5
- package/rn/encrypted/index.js.map +1 -1
- package/session/index.cjs.d.ts +10 -5
- package/session/index.cjs.map +1 -1
- package/session/index.d.ts +10 -5
- package/session/index.js.flow +14 -5
- package/session/index.js.map +1 -1
- package/storage/index.cjs.d.ts +1 -1
- package/storage/index.d.ts +1 -1
- package/storage/index.js.flow +1 -1
- package/tools/index.cjs.d.ts +1 -1
- package/tools/index.d.ts +1 -1
- package/tools/index.js.flow +1 -1
|
@@ -11,13 +11,17 @@ declare interface StorageAdapter {
|
|
|
11
11
|
key: string,
|
|
12
12
|
update: (raw?: any) => any
|
|
13
13
|
): {
|
|
14
|
-
get(raw?: any, ctx?: any): State | Promise<State
|
|
14
|
+
get(raw?: any, ctx?: any): State | Promise<State | void> | void,
|
|
15
15
|
set(value: State, ctx?: any): void,
|
|
16
16
|
...
|
|
17
17
|
};
|
|
18
18
|
keyArea?: any;
|
|
19
19
|
noop?: boolean;
|
|
20
20
|
}
|
|
21
|
+
declare interface StorageAdapterFactory<AdapterConfig> {
|
|
22
|
+
(config?: AdapterConfig): StorageAdapter;
|
|
23
|
+
factory: true;
|
|
24
|
+
}
|
|
21
25
|
declare type Contract<Data> =
|
|
22
26
|
| ((raw: mixed) => boolean)
|
|
23
27
|
| {
|
|
@@ -79,6 +83,16 @@ declare interface ConfigJustSourceTarget<State> {
|
|
|
79
83
|
source: Store<State> | Event<State> | Effect<State, any, any>;
|
|
80
84
|
target: Store<State> | Event<State> | Effect<State, any, any>;
|
|
81
85
|
}
|
|
86
|
+
declare type ConfigStore$1<State, Err = Error> = { ... } & ConfigCommon<
|
|
87
|
+
State,
|
|
88
|
+
Err
|
|
89
|
+
> &
|
|
90
|
+
ConfigJustStore<State>
|
|
91
|
+
declare type ConfigSourceTarget$1<State, Err = Error> = { ... } & ConfigCommon<
|
|
92
|
+
State,
|
|
93
|
+
Err
|
|
94
|
+
> &
|
|
95
|
+
ConfigJustSourceTarget<State>
|
|
82
96
|
declare type ConfigPersist = { ... } & ConfigPersist$1
|
|
83
97
|
declare interface EncryptedStorageConfig {
|
|
84
98
|
serialize?: (value: any) => string;
|
|
@@ -87,13 +101,11 @@ declare interface EncryptedStorageConfig {
|
|
|
87
101
|
declare type ConfigStore<State, Err = Error> = {
|
|
88
102
|
...
|
|
89
103
|
} & EncryptedStorageConfig &
|
|
90
|
-
|
|
91
|
-
ConfigJustStore<State>
|
|
104
|
+
ConfigStore$1<State, Err>
|
|
92
105
|
declare type ConfigSourceTarget<State, Err = Error> = {
|
|
93
106
|
...
|
|
94
107
|
} & EncryptedStorageConfig &
|
|
95
|
-
|
|
96
|
-
ConfigJustSourceTarget<State>
|
|
108
|
+
ConfigSourceTarget$1<State, Err>
|
|
97
109
|
declare interface Persist {
|
|
98
110
|
<State, Err>(config: ConfigSourceTarget<State, Err>): Subscription;
|
|
99
111
|
<State, Err>(config: ConfigStore<State, Err>): Subscription;
|
|
@@ -111,12 +123,14 @@ declare export {
|
|
|
111
123
|
ConfigPersist,
|
|
112
124
|
ConfigSourceTarget,
|
|
113
125
|
ConfigStore,
|
|
126
|
+
Contract,
|
|
114
127
|
Done,
|
|
115
128
|
EncryptedStorageConfig,
|
|
116
129
|
Fail,
|
|
117
130
|
Finally,
|
|
118
131
|
Persist,
|
|
119
132
|
StorageAdapter,
|
|
133
|
+
StorageAdapterFactory,
|
|
120
134
|
createPersist,
|
|
121
135
|
encrypted,
|
|
122
136
|
persist,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/rn/encrypted/index.ts"],"sourcesContent":["import type { Subscription } from 'effector'\nimport type {\n ConfigPersist as BaseConfigPersist,\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/rn/encrypted/index.ts"],"sourcesContent":["import type { Subscription } from 'effector'\nimport type {\n ConfigPersist as BaseConfigPersist,\n ConfigStore as BaseConfigStore,\n ConfigSourceTarget as BaseConfigSourceTarget,\n StorageAdapter,\n} from '../../types'\nimport { persist as base } from '../../core'\nimport { asyncStorage } from '../../async-storage'\nimport EncryptedStorage from 'react-native-encrypted-storage'\n\nexport type {\n Contract,\n Done,\n Fail,\n Finally,\n StorageAdapter,\n StorageAdapterFactory,\n} from '../../types'\n\nexport interface ConfigPersist extends BaseConfigPersist {}\n\nexport interface EncryptedStorageConfig {\n serialize?: (value: any) => string\n deserialize?: (value: string) => any\n}\n\nexport interface ConfigStore<State, Err = Error>\n extends EncryptedStorageConfig,\n BaseConfigStore<State, Err> {}\n\nexport interface ConfigSourceTarget<State, Err = Error>\n extends EncryptedStorageConfig,\n BaseConfigSourceTarget<State, Err> {}\n\nexport interface Persist {\n <State, Err = Error>(config: ConfigSourceTarget<State, Err>): Subscription\n <State, Err = Error>(config: ConfigStore<State, Err>): Subscription\n}\n\n/**\n * Creates `EncryptedStorage` adapter\n */\nencrypted.factory = true as const\nexport function encrypted(config?: EncryptedStorageConfig): StorageAdapter {\n return asyncStorage({\n storage: () => EncryptedStorage,\n ...config,\n })\n}\n\n/**\n * Creates custom partially applied `persist`\n * with predefined `EncryptedStorage` adapter\n */\nexport function createPersist(defaults?: ConfigPersist): Persist {\n return (config) =>\n base({\n adapter: encrypted,\n ...defaults,\n ...config,\n })\n}\n\n/**\n * Default partially applied `persist`\n */\nexport const persist = createPersist()\n"],"names":["encrypted","config","asyncStorage","storage","EncryptedStorage","createPersist","defaults","base","adapter","factory","persist"],"mappings":"wJA4CO,SAASA,EAAUC,GACxB,OAAOC,EAAa,CAClBC,QAASA,IAAMC,KACZH,GAEP,CAMO,SAASI,EAAcC,GAC5B,OAAQL,GACNM,EAAK,CACHC,QAASR,KACNM,KACAL,GAET,CAnBAD,EAAUS,SAAU,EAwBPC,IAAAA,EAAUL"}
|
package/session/index.cjs.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Unit, Store, Event, Effect, Subscription } from 'effector'
|
|
|
2
2
|
|
|
3
3
|
interface StorageAdapter {
|
|
4
4
|
<State>(key: string, update: (raw?: any) => any): {
|
|
5
|
-
get(raw?: any, ctx?: any): State | Promise<State>
|
|
5
|
+
get(raw?: any, ctx?: any): State | Promise<State | undefined> | undefined
|
|
6
6
|
set(value: State, ctx?: any): void
|
|
7
7
|
}
|
|
8
8
|
keyArea?: any
|
|
@@ -62,6 +62,12 @@ interface ConfigJustSourceTarget<State> {
|
|
|
62
62
|
source: Store<State> | Event<State> | Effect<State, any, any>
|
|
63
63
|
target: Store<State> | Event<State> | Effect<State, any, any>
|
|
64
64
|
}
|
|
65
|
+
interface ConfigStore$1<State, Err = Error>
|
|
66
|
+
extends ConfigCommon<State, Err>,
|
|
67
|
+
ConfigJustStore<State> {}
|
|
68
|
+
interface ConfigSourceTarget$1<State, Err = Error>
|
|
69
|
+
extends ConfigCommon<State, Err>,
|
|
70
|
+
ConfigJustSourceTarget<State> {}
|
|
65
71
|
|
|
66
72
|
interface ConfigPersist extends ConfigPersist$1 {
|
|
67
73
|
sync?: boolean | 'force'
|
|
@@ -76,12 +82,10 @@ interface SessionStorageConfig {
|
|
|
76
82
|
}
|
|
77
83
|
interface ConfigStore<State, Err = Error>
|
|
78
84
|
extends SessionStorageConfig,
|
|
79
|
-
|
|
80
|
-
ConfigJustStore<State> {}
|
|
85
|
+
ConfigStore$1<State, Err> {}
|
|
81
86
|
interface ConfigSourceTarget<State, Err = Error>
|
|
82
87
|
extends SessionStorageConfig,
|
|
83
|
-
|
|
84
|
-
ConfigJustSourceTarget<State> {}
|
|
88
|
+
ConfigSourceTarget$1<State, Err> {}
|
|
85
89
|
interface Persist {
|
|
86
90
|
<State, Err = Error>(config: ConfigSourceTarget<State, Err>): Subscription
|
|
87
91
|
<State, Err = Error>(config: ConfigStore<State, Err>): Subscription
|
|
@@ -104,6 +108,7 @@ export {
|
|
|
104
108
|
ConfigPersist,
|
|
105
109
|
ConfigSourceTarget,
|
|
106
110
|
ConfigStore,
|
|
111
|
+
Contract,
|
|
107
112
|
Done,
|
|
108
113
|
Fail,
|
|
109
114
|
Finally,
|
package/session/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/session/index.ts"],"sourcesContent":["import type { Subscription } from 'effector'\nimport type {\n ConfigPersist as BaseConfigPersist,\n
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/session/index.ts"],"sourcesContent":["import type { Subscription } from 'effector'\nimport type {\n ConfigPersist as BaseConfigPersist,\n ConfigStore as BaseConfigStore,\n ConfigSourceTarget as BaseConfigSourceTarget,\n StorageAdapter,\n} from '../types'\nimport { persist as base } from '../core'\nimport { nil } from '../nil'\nimport { storage } from '../storage'\n\nexport type {\n Contract,\n Done,\n Fail,\n Finally,\n StorageAdapter,\n StorageAdapterFactory,\n} from '../types'\n\nexport interface ConfigPersist extends BaseConfigPersist {\n sync?: boolean | 'force'\n timeout?: number\n}\n\nexport interface SessionStorageConfig {\n sync?: boolean | 'force'\n serialize?: (value: any) => string\n deserialize?: (value: string) => any\n timeout?: number\n def?: any\n}\n\nexport interface ConfigStore<State, Err = Error>\n extends SessionStorageConfig,\n BaseConfigStore<State, Err> {}\n\nexport interface ConfigSourceTarget<State, Err = Error>\n extends SessionStorageConfig,\n BaseConfigSourceTarget<State, Err> {}\n\nexport interface Persist {\n <State, Err = Error>(config: ConfigSourceTarget<State, Err>): Subscription\n <State, Err = Error>(config: ConfigStore<State, Err>): Subscription\n}\n\n/**\n * Function, checking if `sessionStorage` exists\n */\nfunction supports() {\n try {\n return typeof sessionStorage !== 'undefined'\n } catch (error) {\n // accessing `sessionStorage` could throw an exception only in one case -\n // when `sessionStorage` IS supported, but blocked by security policies\n return true\n }\n}\n\n/**\n * Creates `sessionStorage` adapter\n */\nsession.factory = true as const\nexport function session(config?: SessionStorageConfig): StorageAdapter {\n return supports()\n ? storage({\n storage: () => sessionStorage,\n ...config,\n })\n : nil({ keyArea: 'session' })\n}\n\n/**\n * Creates custom partially applied `persist`\n * with predefined `sessionStorage` adapter\n */\nexport function createPersist(defaults?: ConfigPersist): Persist {\n return (config) =>\n base({\n adapter: session,\n ...defaults,\n ...config,\n })\n}\n\n/**\n * Default partially applied `persist`\n */\nexport const persist = createPersist()\n"],"names":["session","config","sessionStorage","error","supports","storage","nil","keyArea","createPersist","defaults","base","adapter","factory","persist"],"mappings":"gHA+DO,SAASA,EAAQC,GACtB,OAfF,WACE,IACE,MAAiC,oBAAnBC,cACf,CAAC,MAAOC,GAGP,OAAO,CACT,CACF,CAOSC,GACHC,UAAQ,CACNA,QAASA,IAAMH,kBACZD,IAELK,EAAAA,IAAI,CAAEC,QAAS,WACrB,CAMO,SAASC,EAAcC,GAC5B,OAAQR,GACNS,EAAAA,QAAK,CACHC,QAASX,KACNS,KACAR,GAET,CArBAD,EAAQY,SAAU,EA0BLC,IAAAA,EAAUL"}
|
package/session/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Unit, Store, Event, Effect, Subscription } from 'effector'
|
|
|
2
2
|
|
|
3
3
|
interface StorageAdapter {
|
|
4
4
|
<State>(key: string, update: (raw?: any) => any): {
|
|
5
|
-
get(raw?: any, ctx?: any): State | Promise<State>
|
|
5
|
+
get(raw?: any, ctx?: any): State | Promise<State | undefined> | undefined
|
|
6
6
|
set(value: State, ctx?: any): void
|
|
7
7
|
}
|
|
8
8
|
keyArea?: any
|
|
@@ -62,6 +62,12 @@ interface ConfigJustSourceTarget<State> {
|
|
|
62
62
|
source: Store<State> | Event<State> | Effect<State, any, any>
|
|
63
63
|
target: Store<State> | Event<State> | Effect<State, any, any>
|
|
64
64
|
}
|
|
65
|
+
interface ConfigStore$1<State, Err = Error>
|
|
66
|
+
extends ConfigCommon<State, Err>,
|
|
67
|
+
ConfigJustStore<State> {}
|
|
68
|
+
interface ConfigSourceTarget$1<State, Err = Error>
|
|
69
|
+
extends ConfigCommon<State, Err>,
|
|
70
|
+
ConfigJustSourceTarget<State> {}
|
|
65
71
|
|
|
66
72
|
interface ConfigPersist extends ConfigPersist$1 {
|
|
67
73
|
sync?: boolean | 'force'
|
|
@@ -76,12 +82,10 @@ interface SessionStorageConfig {
|
|
|
76
82
|
}
|
|
77
83
|
interface ConfigStore<State, Err = Error>
|
|
78
84
|
extends SessionStorageConfig,
|
|
79
|
-
|
|
80
|
-
ConfigJustStore<State> {}
|
|
85
|
+
ConfigStore$1<State, Err> {}
|
|
81
86
|
interface ConfigSourceTarget<State, Err = Error>
|
|
82
87
|
extends SessionStorageConfig,
|
|
83
|
-
|
|
84
|
-
ConfigJustSourceTarget<State> {}
|
|
88
|
+
ConfigSourceTarget$1<State, Err> {}
|
|
85
89
|
interface Persist {
|
|
86
90
|
<State, Err = Error>(config: ConfigSourceTarget<State, Err>): Subscription
|
|
87
91
|
<State, Err = Error>(config: ConfigStore<State, Err>): Subscription
|
|
@@ -104,6 +108,7 @@ export {
|
|
|
104
108
|
ConfigPersist,
|
|
105
109
|
ConfigSourceTarget,
|
|
106
110
|
ConfigStore,
|
|
111
|
+
Contract,
|
|
107
112
|
Done,
|
|
108
113
|
Fail,
|
|
109
114
|
Finally,
|
package/session/index.js.flow
CHANGED
|
@@ -11,7 +11,7 @@ declare interface StorageAdapter {
|
|
|
11
11
|
key: string,
|
|
12
12
|
update: (raw?: any) => any
|
|
13
13
|
): {
|
|
14
|
-
get(raw?: any, ctx?: any): State | Promise<State
|
|
14
|
+
get(raw?: any, ctx?: any): State | Promise<State | void> | void,
|
|
15
15
|
set(value: State, ctx?: any): void,
|
|
16
16
|
...
|
|
17
17
|
};
|
|
@@ -83,6 +83,16 @@ declare interface ConfigJustSourceTarget<State> {
|
|
|
83
83
|
source: Store<State> | Event<State> | Effect<State, any, any>;
|
|
84
84
|
target: Store<State> | Event<State> | Effect<State, any, any>;
|
|
85
85
|
}
|
|
86
|
+
declare type ConfigStore$1<State, Err = Error> = { ... } & ConfigCommon<
|
|
87
|
+
State,
|
|
88
|
+
Err
|
|
89
|
+
> &
|
|
90
|
+
ConfigJustStore<State>
|
|
91
|
+
declare type ConfigSourceTarget$1<State, Err = Error> = { ... } & ConfigCommon<
|
|
92
|
+
State,
|
|
93
|
+
Err
|
|
94
|
+
> &
|
|
95
|
+
ConfigJustSourceTarget<State>
|
|
86
96
|
declare type ConfigPersist = {
|
|
87
97
|
sync?: boolean | 'force',
|
|
88
98
|
timeout?: number,
|
|
@@ -96,13 +106,11 @@ declare interface SessionStorageConfig {
|
|
|
96
106
|
def?: any;
|
|
97
107
|
}
|
|
98
108
|
declare type ConfigStore<State, Err = Error> = { ... } & SessionStorageConfig &
|
|
99
|
-
|
|
100
|
-
ConfigJustStore<State>
|
|
109
|
+
ConfigStore$1<State, Err>
|
|
101
110
|
declare type ConfigSourceTarget<State, Err = Error> = {
|
|
102
111
|
...
|
|
103
112
|
} & SessionStorageConfig &
|
|
104
|
-
|
|
105
|
-
ConfigJustSourceTarget<State>
|
|
113
|
+
ConfigSourceTarget$1<State, Err>
|
|
106
114
|
declare interface Persist {
|
|
107
115
|
<State, Err>(config: ConfigSourceTarget<State, Err>): Subscription;
|
|
108
116
|
<State, Err>(config: ConfigStore<State, Err>): Subscription;
|
|
@@ -120,6 +128,7 @@ declare export {
|
|
|
120
128
|
ConfigPersist,
|
|
121
129
|
ConfigSourceTarget,
|
|
122
130
|
ConfigStore,
|
|
131
|
+
Contract,
|
|
123
132
|
Done,
|
|
124
133
|
Fail,
|
|
125
134
|
Finally,
|
package/session/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/session/index.ts"],"sourcesContent":["import type { Subscription } from 'effector'\nimport type {\n ConfigPersist as BaseConfigPersist,\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/session/index.ts"],"sourcesContent":["import type { Subscription } from 'effector'\nimport type {\n ConfigPersist as BaseConfigPersist,\n ConfigStore as BaseConfigStore,\n ConfigSourceTarget as BaseConfigSourceTarget,\n StorageAdapter,\n} from '../types'\nimport { persist as base } from '../core'\nimport { nil } from '../nil'\nimport { storage } from '../storage'\n\nexport type {\n Contract,\n Done,\n Fail,\n Finally,\n StorageAdapter,\n StorageAdapterFactory,\n} from '../types'\n\nexport interface ConfigPersist extends BaseConfigPersist {\n sync?: boolean | 'force'\n timeout?: number\n}\n\nexport interface SessionStorageConfig {\n sync?: boolean | 'force'\n serialize?: (value: any) => string\n deserialize?: (value: string) => any\n timeout?: number\n def?: any\n}\n\nexport interface ConfigStore<State, Err = Error>\n extends SessionStorageConfig,\n BaseConfigStore<State, Err> {}\n\nexport interface ConfigSourceTarget<State, Err = Error>\n extends SessionStorageConfig,\n BaseConfigSourceTarget<State, Err> {}\n\nexport interface Persist {\n <State, Err = Error>(config: ConfigSourceTarget<State, Err>): Subscription\n <State, Err = Error>(config: ConfigStore<State, Err>): Subscription\n}\n\n/**\n * Function, checking if `sessionStorage` exists\n */\nfunction supports() {\n try {\n return typeof sessionStorage !== 'undefined'\n } catch (error) {\n // accessing `sessionStorage` could throw an exception only in one case -\n // when `sessionStorage` IS supported, but blocked by security policies\n return true\n }\n}\n\n/**\n * Creates `sessionStorage` adapter\n */\nsession.factory = true as const\nexport function session(config?: SessionStorageConfig): StorageAdapter {\n return supports()\n ? storage({\n storage: () => sessionStorage,\n ...config,\n })\n : nil({ keyArea: 'session' })\n}\n\n/**\n * Creates custom partially applied `persist`\n * with predefined `sessionStorage` adapter\n */\nexport function createPersist(defaults?: ConfigPersist): Persist {\n return (config) =>\n base({\n adapter: session,\n ...defaults,\n ...config,\n })\n}\n\n/**\n * Default partially applied `persist`\n */\nexport const persist = createPersist()\n"],"names":["session","config","sessionStorage","error","supports","storage","nil","keyArea","createPersist","defaults","base","adapter","factory","persist"],"mappings":"+HA+DO,SAASA,EAAQC,GACtB,OAfF,WACE,IACE,MAAiC,oBAAnBC,cACf,CAAC,MAAOC,GAGP,OAAO,CACT,CACF,CAOSC,GACHC,EAAQ,CACNA,QAASA,IAAMH,kBACZD,IAELK,EAAI,CAAEC,QAAS,WACrB,CAMO,SAASC,EAAcC,GAC5B,OAAQR,GACNS,EAAK,CACHC,QAASX,KACNS,KACAR,GAET,CArBAD,EAAQY,SAAU,EA0BLC,IAAAA,EAAUL"}
|
package/storage/index.cjs.d.ts
CHANGED
package/storage/index.d.ts
CHANGED
package/storage/index.js.flow
CHANGED
|
@@ -10,7 +10,7 @@ declare interface StorageAdapter {
|
|
|
10
10
|
key: string,
|
|
11
11
|
update: (raw?: any) => any
|
|
12
12
|
): {
|
|
13
|
-
get(raw?: any, ctx?: any): State | Promise<State
|
|
13
|
+
get(raw?: any, ctx?: any): State | Promise<State | void> | void,
|
|
14
14
|
set(value: State, ctx?: any): void,
|
|
15
15
|
...
|
|
16
16
|
};
|
package/tools/index.cjs.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Store, Effect, Event } from 'effector'
|
|
|
2
2
|
|
|
3
3
|
interface StorageAdapter {
|
|
4
4
|
<State>(key: string, update: (raw?: any) => any): {
|
|
5
|
-
get(raw?: any, ctx?: any): State | Promise<State>
|
|
5
|
+
get(raw?: any, ctx?: any): State | Promise<State | undefined> | undefined
|
|
6
6
|
set(value: State, ctx?: any): void
|
|
7
7
|
}
|
|
8
8
|
keyArea?: any
|
package/tools/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Store, Effect, Event } from 'effector'
|
|
|
2
2
|
|
|
3
3
|
interface StorageAdapter {
|
|
4
4
|
<State>(key: string, update: (raw?: any) => any): {
|
|
5
|
-
get(raw?: any, ctx?: any): State | Promise<State>
|
|
5
|
+
get(raw?: any, ctx?: any): State | Promise<State | undefined> | undefined
|
|
6
6
|
set(value: State, ctx?: any): void
|
|
7
7
|
}
|
|
8
8
|
keyArea?: any
|
package/tools/index.js.flow
CHANGED
|
@@ -24,7 +24,7 @@ declare interface StorageAdapter {
|
|
|
24
24
|
key: string,
|
|
25
25
|
update: (raw?: any) => any
|
|
26
26
|
): {
|
|
27
|
-
get(raw?: any, ctx?: any): State | Promise<State
|
|
27
|
+
get(raw?: any, ctx?: any): State | Promise<State | void> | void,
|
|
28
28
|
set(value: State, ctx?: any): void,
|
|
29
29
|
...
|
|
30
30
|
};
|