effector-storage 4.2.1 → 5.0.0

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.
Files changed (108) hide show
  1. package/README.md +87 -46
  2. package/async-storage/index.cjs +2 -0
  3. package/async-storage/index.cjs.d.ts +21 -0
  4. package/async-storage/index.cjs.map +1 -0
  5. package/async-storage/index.d.ts +21 -0
  6. package/async-storage/index.js +2 -0
  7. package/async-storage/index.js.flow +19 -0
  8. package/async-storage/index.js.map +1 -0
  9. package/{fp → async-storage}/package.json +0 -0
  10. package/index.cjs +1 -1
  11. package/index.cjs.d.ts +37 -17
  12. package/index.cjs.map +1 -1
  13. package/index.d.ts +37 -17
  14. package/index.js +1 -1
  15. package/index.js.flow +31 -17
  16. package/index.js.map +1 -1
  17. package/local/index.cjs +1 -1
  18. package/local/index.cjs.d.ts +76 -21
  19. package/local/index.cjs.map +1 -1
  20. package/local/index.d.ts +76 -21
  21. package/local/index.js +1 -1
  22. package/local/index.js.flow +84 -21
  23. package/local/index.js.map +1 -1
  24. package/memory/index.cjs +1 -1
  25. package/memory/index.cjs.d.ts +68 -18
  26. package/memory/index.cjs.map +1 -1
  27. package/memory/index.d.ts +68 -18
  28. package/memory/index.js +1 -1
  29. package/memory/index.js.flow +81 -18
  30. package/memory/index.js.map +1 -1
  31. package/nil/index.cjs +1 -1
  32. package/nil/index.cjs.d.ts +1 -1
  33. package/nil/index.cjs.map +1 -1
  34. package/nil/index.d.ts +1 -1
  35. package/nil/index.js +1 -1
  36. package/nil/index.js.flow +2 -2
  37. package/nil/index.js.map +1 -1
  38. package/package.json +21 -27
  39. package/query/index.cjs +1 -1
  40. package/query/index.cjs.d.ts +77 -25
  41. package/query/index.cjs.map +1 -1
  42. package/query/index.d.ts +77 -25
  43. package/query/index.js +1 -1
  44. package/query/index.js.flow +87 -27
  45. package/query/index.js.map +1 -1
  46. package/rn/async/index.cjs +2 -0
  47. package/rn/async/index.cjs.d.ts +89 -0
  48. package/rn/async/index.cjs.map +1 -0
  49. package/rn/async/index.d.ts +89 -0
  50. package/rn/async/index.js +2 -0
  51. package/rn/async/index.js.flow +98 -0
  52. package/rn/async/index.js.map +1 -0
  53. package/{local/fp → rn/async}/package.json +0 -0
  54. package/rn/encrypted/index.cjs +2 -0
  55. package/rn/encrypted/index.cjs.d.ts +89 -0
  56. package/rn/encrypted/index.cjs.map +1 -0
  57. package/rn/encrypted/index.d.ts +89 -0
  58. package/rn/encrypted/index.js +2 -0
  59. package/rn/encrypted/index.js.flow +98 -0
  60. package/rn/encrypted/index.js.map +1 -0
  61. package/{memory/fp → rn/encrypted}/package.json +0 -0
  62. package/session/index.cjs +1 -1
  63. package/session/index.cjs.d.ts +76 -21
  64. package/session/index.cjs.map +1 -1
  65. package/session/index.d.ts +76 -21
  66. package/session/index.js +1 -1
  67. package/session/index.js.flow +84 -21
  68. package/session/index.js.map +1 -1
  69. package/storage/index.cjs.map +1 -1
  70. package/storage/index.js.flow +1 -1
  71. package/storage/index.js.map +1 -1
  72. package/fp/index.cjs +0 -2
  73. package/fp/index.cjs.d.ts +0 -19
  74. package/fp/index.cjs.map +0 -1
  75. package/fp/index.d.ts +0 -19
  76. package/fp/index.js +0 -2
  77. package/fp/index.js.flow +0 -21
  78. package/fp/index.js.map +0 -1
  79. package/local/fp/index.cjs +0 -2
  80. package/local/fp/index.cjs.d.ts +0 -39
  81. package/local/fp/index.cjs.map +0 -1
  82. package/local/fp/index.d.ts +0 -39
  83. package/local/fp/index.js +0 -2
  84. package/local/fp/index.js.flow +0 -50
  85. package/local/fp/index.js.map +0 -1
  86. package/memory/fp/index.cjs +0 -2
  87. package/memory/fp/index.cjs.d.ts +0 -36
  88. package/memory/fp/index.cjs.map +0 -1
  89. package/memory/fp/index.d.ts +0 -36
  90. package/memory/fp/index.js +0 -2
  91. package/memory/fp/index.js.flow +0 -47
  92. package/memory/fp/index.js.map +0 -1
  93. package/query/fp/index.cjs +0 -2
  94. package/query/fp/index.cjs.d.ts +0 -45
  95. package/query/fp/index.cjs.map +0 -1
  96. package/query/fp/index.d.ts +0 -45
  97. package/query/fp/index.js +0 -2
  98. package/query/fp/index.js.flow +0 -60
  99. package/query/fp/index.js.map +0 -1
  100. package/query/fp/package.json +0 -7
  101. package/session/fp/index.cjs +0 -2
  102. package/session/fp/index.cjs.d.ts +0 -39
  103. package/session/fp/index.cjs.map +0 -1
  104. package/session/fp/index.d.ts +0 -39
  105. package/session/fp/index.js +0 -2
  106. package/session/fp/index.js.flow +0 -50
  107. package/session/fp/index.js.map +0 -1
  108. package/session/fp/package.json +0 -7
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/session/fp/index.ts"],"sourcesContent":["import type { Unit, Store } from 'effector'\nimport type { Done, Fail, Finally } from '../..'\nimport { persist as parent } from '..'\n\nexport interface Config<State, Err = Error> {\n done?: Unit<Done<State>>\n fail?: Unit<Fail<Err>>\n finally?: Unit<Finally<State, Err>>\n pickup?: Unit<any>\n key?: string\n sync?: boolean // DEPRECATED\n serialize?: (value: any) => string\n deserialize?: (value: string) => any\n}\n\n/**\n * Partially applied `persist` with predefined `sessionStorage` adapter and curried `store`\n */\n// FIXME: how to infer state backwards?\nexport function persist<Err = Error>(config: Config<any, Err> = {}) {\n return <State>(store: Store<State>): Store<State> => {\n parent(Object.assign({ store }, config))\n return store\n }\n}\n"],"names":["config","store","parent","Object","assign"],"mappings":"2DAmBO,SAA8BA,EAA2B,WAC/CC,IACbC,UAAOC,OAAOC,OAAO,CAAEH,MAAAA,GAASD,IACzBC"}
@@ -1,39 +0,0 @@
1
- import { Unit, Store } from 'effector'
2
-
3
- declare type Done<State> = {
4
- key: string
5
- operation: 'set' | 'get'
6
- value: State
7
- }
8
- declare type Fail<Err> = {
9
- key: string
10
- operation: 'set' | 'get'
11
- error: Err
12
- value?: any
13
- }
14
- declare type Finally<State, Err> =
15
- | (Done<State> & {
16
- status: 'done'
17
- })
18
- | (Fail<Err> & {
19
- status: 'fail'
20
- })
21
-
22
- interface Config<State, Err = Error> {
23
- done?: Unit<Done<State>>
24
- fail?: Unit<Fail<Err>>
25
- finally?: Unit<Finally<State, Err>>
26
- pickup?: Unit<any>
27
- key?: string
28
- sync?: boolean
29
- serialize?: (value: any) => string
30
- deserialize?: (value: string) => any
31
- }
32
- /**
33
- * Partially applied `persist` with predefined `sessionStorage` adapter and curried `store`
34
- */
35
- declare function persist<Err = Error>(
36
- config?: Config<any, Err>
37
- ): <State>(store: Store<State>) => Store<State>
38
-
39
- export { Config, persist }
@@ -1,2 +0,0 @@
1
- import{persist as r}from"../index.js";function s(s={}){return t=>(r(Object.assign({store:t},s)),t)}export{s as persist};
2
- //# sourceMappingURL=index.js.map
@@ -1,50 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.14.1
5
- * @flow
6
- */
7
-
8
- import { Unit, Store } from 'effector'
9
- declare type Done<State> = {
10
- key: string,
11
- operation: 'set' | 'get',
12
- value: State,
13
- ...
14
- }
15
- declare type Fail<Err> = {
16
- key: string,
17
- operation: 'set' | 'get',
18
- error: Err,
19
- value?: any,
20
- ...
21
- }
22
- declare type Finally<State, Err> =
23
- | {
24
- ...Done<State>,
25
- ...{
26
- status: 'done',
27
- ...
28
- },
29
- }
30
- | {
31
- ...Fail<Err>,
32
- ...{
33
- status: 'fail',
34
- ...
35
- },
36
- }
37
- declare interface Config<State, Err = Error> {
38
- done?: Unit<Done<State>>;
39
- fail?: Unit<Fail<Err>>;
40
- finally?: Unit<Finally<State, Err>>;
41
- pickup?: Unit<any>;
42
- key?: string;
43
- sync?: boolean;
44
- serialize?: (value: any) => string;
45
- deserialize?: (value: string) => any;
46
- }
47
- declare function persist<Err>(
48
- config?: Config<any, Err>
49
- ): <State>(store: Store<State>) => Store<State>
50
- declare export { Config, persist }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/session/fp/index.ts"],"sourcesContent":["import type { Unit, Store } from 'effector'\nimport type { Done, Fail, Finally } from '../..'\nimport { persist as parent } from '..'\n\nexport interface Config<State, Err = Error> {\n done?: Unit<Done<State>>\n fail?: Unit<Fail<Err>>\n finally?: Unit<Finally<State, Err>>\n pickup?: Unit<any>\n key?: string\n sync?: boolean // DEPRECATED\n serialize?: (value: any) => string\n deserialize?: (value: string) => any\n}\n\n/**\n * Partially applied `persist` with predefined `sessionStorage` adapter and curried `store`\n */\n// FIXME: how to infer state backwards?\nexport function persist<Err = Error>(config: Config<any, Err> = {}) {\n return <State>(store: Store<State>): Store<State> => {\n parent(Object.assign({ store }, config))\n return store\n }\n}\n"],"names":["persist","config","store","parent","Object","assign"],"mappings":"sCAmBO,SAASA,EAAqBC,EAA2B,WAC/CC,IACbC,EAAOC,OAAOC,OAAO,CAAEH,MAAAA,GAASD,IACzBC"}
@@ -1,7 +0,0 @@
1
- {
2
- "type": "module",
3
- "main": "index.cjs",
4
- "module": "index.js",
5
- "react-native": "index.js",
6
- "types": "index.d.ts"
7
- }