effector-storage 4.4.0 → 5.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.
Files changed (94) hide show
  1. package/README.md +46 -53
  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.map +1 -1
  12. package/index.js +1 -1
  13. package/index.js.flow +1 -1
  14. package/index.js.map +1 -1
  15. package/local/index.cjs +1 -1
  16. package/local/index.cjs.map +1 -1
  17. package/local/index.js +1 -1
  18. package/local/index.js.flow +1 -1
  19. package/local/index.js.map +1 -1
  20. package/memory/index.cjs +1 -1
  21. package/memory/index.cjs.map +1 -1
  22. package/memory/index.js +1 -1
  23. package/memory/index.js.flow +1 -1
  24. package/memory/index.js.map +1 -1
  25. package/nil/index.cjs.map +1 -1
  26. package/nil/index.js.flow +1 -1
  27. package/nil/index.js.map +1 -1
  28. package/package.json +20 -26
  29. package/query/index.cjs +1 -1
  30. package/query/index.cjs.map +1 -1
  31. package/query/index.js +1 -1
  32. package/query/index.js.flow +1 -1
  33. package/query/index.js.map +1 -1
  34. package/rn/async/index.cjs +2 -0
  35. package/rn/async/index.cjs.d.ts +89 -0
  36. package/rn/async/index.cjs.map +1 -0
  37. package/rn/async/index.d.ts +89 -0
  38. package/rn/async/index.js +2 -0
  39. package/rn/async/index.js.flow +98 -0
  40. package/rn/async/index.js.map +1 -0
  41. package/{local/fp → rn/async}/package.json +0 -0
  42. package/rn/encrypted/index.cjs +2 -0
  43. package/rn/encrypted/index.cjs.d.ts +89 -0
  44. package/rn/encrypted/index.cjs.map +1 -0
  45. package/rn/encrypted/index.d.ts +89 -0
  46. package/rn/encrypted/index.js +2 -0
  47. package/rn/encrypted/index.js.flow +98 -0
  48. package/rn/encrypted/index.js.map +1 -0
  49. package/{memory/fp → rn/encrypted}/package.json +0 -0
  50. package/session/index.cjs +1 -1
  51. package/session/index.cjs.map +1 -1
  52. package/session/index.js +1 -1
  53. package/session/index.js.flow +1 -1
  54. package/session/index.js.map +1 -1
  55. package/storage/index.cjs.map +1 -1
  56. package/storage/index.js.flow +1 -1
  57. package/storage/index.js.map +1 -1
  58. package/fp/index.cjs +0 -2
  59. package/fp/index.cjs.d.ts +0 -55
  60. package/fp/index.cjs.map +0 -1
  61. package/fp/index.d.ts +0 -55
  62. package/fp/index.js +0 -2
  63. package/fp/index.js.flow +0 -76
  64. package/fp/index.js.map +0 -1
  65. package/local/fp/index.cjs +0 -2
  66. package/local/fp/index.cjs.d.ts +0 -46
  67. package/local/fp/index.cjs.map +0 -1
  68. package/local/fp/index.d.ts +0 -46
  69. package/local/fp/index.js +0 -2
  70. package/local/fp/index.js.flow +0 -63
  71. package/local/fp/index.js.map +0 -1
  72. package/memory/fp/index.cjs +0 -2
  73. package/memory/fp/index.cjs.d.ts +0 -43
  74. package/memory/fp/index.cjs.map +0 -1
  75. package/memory/fp/index.d.ts +0 -43
  76. package/memory/fp/index.js +0 -2
  77. package/memory/fp/index.js.flow +0 -64
  78. package/memory/fp/index.js.map +0 -1
  79. package/query/fp/index.cjs +0 -2
  80. package/query/fp/index.cjs.d.ts +0 -57
  81. package/query/fp/index.cjs.map +0 -1
  82. package/query/fp/index.d.ts +0 -57
  83. package/query/fp/index.js +0 -2
  84. package/query/fp/index.js.flow +0 -67
  85. package/query/fp/index.js.map +0 -1
  86. package/query/fp/package.json +0 -7
  87. package/session/fp/index.cjs +0 -2
  88. package/session/fp/index.cjs.d.ts +0 -46
  89. package/session/fp/index.cjs.map +0 -1
  90. package/session/fp/index.d.ts +0 -46
  91. package/session/fp/index.js +0 -2
  92. package/session/fp/index.js.flow +0 -63
  93. package/session/fp/index.js.map +0 -1
  94. package/session/fp/package.json +0 -7
@@ -1,2 +0,0 @@
1
- import{persist as r}from"../index.js";var e=(r=>e=>(console.error("/fp is deprecated, use regular form instead"),s=>(r({store:s,...e}),s)))(r);export{e as persist};
2
- //# sourceMappingURL=index.js.map
@@ -1,63 +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 * as effector from 'effector'
9
- import { Unit } from 'effector'
10
- import { AdapterConfig } from '..'
11
- declare export {
12
- ConfigPersist,
13
- Done,
14
- Fail,
15
- Finally,
16
- Persist,
17
- StorageAdapter,
18
- } from '..'
19
- declare type Done<State> = {
20
- key: string,
21
- keyPrefix: string,
22
- operation: 'set' | 'get',
23
- value: State,
24
- ...
25
- }
26
- declare type Fail<Err> = {
27
- key: string,
28
- keyPrefix: string,
29
- operation: 'set' | 'get',
30
- error: Err,
31
- value?: any,
32
- ...
33
- }
34
- declare type Finally<State, Err> =
35
- | {
36
- ...Done<State>,
37
- ...{
38
- status: 'done',
39
- ...
40
- },
41
- }
42
- | {
43
- ...Fail<Err>,
44
- ...{
45
- status: 'fail',
46
- ...
47
- },
48
- }
49
- declare interface ConfigCommon<State, Err = Error> {
50
- clock?: Unit<any>;
51
- done?: Unit<Done<State>>;
52
- fail?: Unit<Fail<Err>>;
53
- finally?: Unit<Finally<State, Err>>;
54
- pickup?: Unit<any>;
55
- key?: string;
56
- keyPrefix?: string;
57
- }
58
- declare type ConfigStore<State, Err = Error> = { ... } & AdapterConfig &
59
- ConfigCommon<State, Err>
60
- declare var persist: (
61
- config?: ConfigStore<any, Error> | void
62
- ) => <State>(store: effector.Store<State>) => effector.Store<State>
63
- declare export { ConfigStore, persist }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/fp-helper.ts","../../../src/session/fp/index.ts"],"sourcesContent":["import type { Store, Subscription } from 'effector'\n\ntype LikePersist = {\n (config: any): Subscription\n}\n\ntype Curried = {\n <State>(store: Store<State>): Store<State>\n}\n\n/**\n * Helper to make any `persist` function like functional\n */\nexport const fp =\n <Config>(persist: LikePersist) =>\n (config?: Config): Curried => {\n console.error(`/fp is deprecated, use regular form instead`)\n return <State>(store: Store<State>): Store<State> => {\n persist({ store, ...config })\n return store\n }\n }\n","import type { AdapterConfig } from '..'\nimport type { ConfigCommon } from '../../types'\nimport { persist as parent } from '..'\nimport { fp } from '../../fp-helper'\n\nexport type {\n ConfigPersist,\n Done,\n Fail,\n Finally,\n Persist,\n StorageAdapter,\n} from '..'\n\nexport interface ConfigStore<State, Err = Error>\n extends AdapterConfig,\n ConfigCommon<State, Err> {}\n\n/**\n * Partially applied `persist` with predefined `sessionStorage` adapter and curried `store`\n */\nexport const persist = fp<ConfigStore<any>>(parent)\n"],"names":["persist","config","console","error","store","fp","parent"],"mappings":"sCAaO,ICQMA,EDPFA,CAAAA,GACRC,IACCC,QAAQC,MAAO,+CACAC,IACbJ,EAAQ,CAAEI,MAAAA,KAAUH,IACbG,ICEUC,CAAqBC"}
@@ -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
- }