atom.io 0.2.0 → 0.3.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.
@@ -1,23 +1,11 @@
1
- import type * as Rx from "rxjs"
2
-
1
+ export * from "./atom-internal"
2
+ export * from "./families-internal"
3
3
  export * from "./get"
4
- export * from "./set"
5
4
  export * from "./is-default"
5
+ export * from "./operation"
6
6
  export * from "./selector-internal"
7
+ export * from "./set"
7
8
  export * from "./store"
8
9
  export * from "./subscribe-internal"
9
- export * from "./operation"
10
+ export * from "./timeline-internal"
10
11
  export * from "./transaction-internal"
11
-
12
- export type Atom<T> = {
13
- key: string
14
- subject: Rx.Subject<{ newValue: T; oldValue: T }>
15
- default: T
16
- }
17
- export type Selector<T> = {
18
- key: string
19
- subject: Rx.Subject<{ newValue: T; oldValue: T }>
20
- get: () => T
21
- set: (newValue: T | ((oldValue: T) => T)) => void
22
- }
23
- export type ReadonlySelector<T> = Omit<Selector<T>, `set`>
@@ -1,13 +1,29 @@
1
- import HAMT from "hamt_plus"
2
-
3
1
  import type { Store } from "."
4
- import { IMPLICIT, traceAllSelectorAtoms } from "."
2
+ import { target, IMPLICIT, traceAllSelectorAtoms } from "."
5
3
 
6
4
  export const isAtomDefault = (
7
5
  key: string,
8
6
  store: Store = IMPLICIT.STORE
9
7
  ): boolean => {
10
- return HAMT.get(key, store.atomsAreDefault)
8
+ const core = target(store)
9
+ return core.atomsThatAreDefault.has(key)
10
+ }
11
+
12
+ export const markAtomAsDefault = (
13
+ key: string,
14
+ store: Store = IMPLICIT.STORE
15
+ ): void => {
16
+ const core = target(store)
17
+ core.atomsThatAreDefault = new Set(core.atomsThatAreDefault).add(key)
18
+ }
19
+
20
+ export const markAtomAsNotDefault = (
21
+ key: string,
22
+ store: Store = IMPLICIT.STORE
23
+ ): void => {
24
+ const core = target(store)
25
+ core.atomsThatAreDefault = new Set(target(store).atomsThatAreDefault)
26
+ core.atomsThatAreDefault.delete(key)
11
27
  }
12
28
 
13
29
  export const isSelectorDefault = (
@@ -1,49 +1,144 @@
1
+ import type { Hamt } from "hamt_plus"
1
2
  import HAMT from "hamt_plus"
2
3
 
3
4
  import type { Atom, ReadonlySelector, Selector } from "."
5
+ import { target } from "."
4
6
  import type { Store } from "./store"
5
7
  import { IMPLICIT } from "./store"
8
+ import type { StateToken } from ".."
6
9
 
7
- export const startAction = (store: Store): void => {
8
- store.operation = {
10
+ export type OperationProgress =
11
+ | {
12
+ open: false
13
+ }
14
+ | {
15
+ open: true
16
+ done: Set<string>
17
+ prev: Hamt<any, string>
18
+ time: number
19
+ token: StateToken<any>
20
+ }
21
+
22
+ export const openOperation = (token: StateToken<any>, store: Store): void => {
23
+ const core = target(store)
24
+ if (core.operation.open) {
25
+ console.warn(core.operation.open)
26
+ store.config.logger?.error(
27
+ `❌ failed to setState to "${token.key}" during a setState for "${core.operation.token.key}"`
28
+ )
29
+ throw Symbol(`violation`)
30
+ }
31
+ core.operation = {
9
32
  open: true,
10
33
  done: new Set(),
11
34
  prev: store.valueMap,
35
+ time: Date.now(),
36
+ token,
12
37
  }
13
- store.config.logger?.info(`⭕`, `operation start`)
38
+ store.config.logger?.info(`⭕ operation start from "${token.key}"`)
14
39
  }
15
- export const finishAction = (store: Store): void => {
16
- store.operation = { open: false }
17
- store.config.logger?.info(`🔴`, `operation done`)
40
+ export const closeOperation = (store: Store): void => {
41
+ const core = target(store)
42
+ core.operation = { open: false }
43
+ store.config.logger?.info(`🔴 operation done`)
18
44
  }
19
45
 
20
46
  export const isDone = (key: string, store: Store = IMPLICIT.STORE): boolean => {
21
- if (!store.operation.open) {
47
+ const core = target(store)
48
+ if (!core.operation.open) {
22
49
  store.config.logger?.warn(
23
- `isDone called outside of an action. This is probably a bug.`
50
+ `isDone called outside of an operation. This is probably a bug.`
24
51
  )
25
52
  return true
26
53
  }
27
- return store.operation.done.has(key)
54
+ return core.operation.done.has(key)
28
55
  }
29
56
  export const markDone = (key: string, store: Store = IMPLICIT.STORE): void => {
30
- if (!store.operation.open) {
57
+ const core = target(store)
58
+ if (!core.operation.open) {
31
59
  store.config.logger?.warn(
32
- `markDone called outside of an action. This is probably a bug.`
60
+ `markDone called outside of an operation. This is probably a bug.`
33
61
  )
34
62
  return
35
63
  }
36
- store.operation.done.add(key)
64
+ core.operation.done.add(key)
37
65
  }
38
66
  export const recallState = <T>(
39
67
  state: Atom<T> | ReadonlySelector<T> | Selector<T>,
40
68
  store: Store = IMPLICIT.STORE
41
69
  ): T => {
42
- if (!store.operation.open) {
70
+ const core = target(store)
71
+ if (!core.operation.open) {
43
72
  store.config.logger?.warn(
44
- `recall called outside of an action. This is probably a bug.`
73
+ `recall called outside of an operation. This is probably a bug.`
45
74
  )
46
- return HAMT.get(state.key, store.valueMap)
75
+ return HAMT.get(state.key, core.valueMap)
47
76
  }
48
- return HAMT.get(state.key, store.operation.prev)
77
+ return HAMT.get(state.key, core.operation.prev)
78
+ }
79
+
80
+ export const cacheValue = (
81
+ key: string,
82
+ value: unknown,
83
+ store: Store = IMPLICIT.STORE
84
+ ): void => {
85
+ const core = target(store)
86
+ core.valueMap = HAMT.set(key, value, core.valueMap)
87
+ }
88
+
89
+ export const evictCachedValue = (
90
+ key: string,
91
+ store: Store = IMPLICIT.STORE
92
+ ): void => {
93
+ const core = target(store)
94
+ core.valueMap = HAMT.remove(key, core.valueMap)
95
+ }
96
+ export const readCachedValue = <T>(
97
+ key: string,
98
+ store: Store = IMPLICIT.STORE
99
+ ): T => HAMT.get(key, target(store).valueMap)
100
+
101
+ export const isValueCached = (
102
+ key: string,
103
+ store: Store = IMPLICIT.STORE
104
+ ): boolean => HAMT.has(key, target(store).valueMap)
105
+
106
+ export const storeAtom = (
107
+ atom: Atom<any>,
108
+ store: Store = IMPLICIT.STORE
109
+ ): void => {
110
+ const core = target(store)
111
+ core.atoms = HAMT.set(atom.key, atom, core.atoms)
112
+ }
113
+
114
+ export const storeSelector = (
115
+ selector: Selector<any>,
116
+ store: Store = IMPLICIT.STORE
117
+ ): void => {
118
+ const core = target(store)
119
+ core.selectors = HAMT.set(selector.key, selector, core.selectors)
120
+ }
121
+
122
+ export const storeReadonlySelector = (
123
+ selector: ReadonlySelector<any>,
124
+ store: Store = IMPLICIT.STORE
125
+ ): void => {
126
+ const core = target(store)
127
+ core.readonlySelectors = HAMT.set(
128
+ selector.key,
129
+ selector,
130
+ core.readonlySelectors
131
+ )
132
+ }
133
+
134
+ export const hasKeyBeenUsed = (
135
+ key: string,
136
+ store: Store = IMPLICIT.STORE
137
+ ): boolean => {
138
+ const core = target(store)
139
+ return (
140
+ HAMT.has(key, core.atoms) ||
141
+ HAMT.has(key, core.selectors) ||
142
+ HAMT.has(key, core.readonlySelectors)
143
+ )
49
144
  }
@@ -1,5 +1,13 @@
1
+ import HAMT from "hamt_plus"
2
+ import * as Rx from "rxjs"
3
+
4
+ import { become } from "~/packages/anvl/src/function"
5
+
1
6
  import type { Store } from "."
2
7
  import {
8
+ target,
9
+ cacheValue,
10
+ markDone,
3
11
  lookup,
4
12
  IMPLICIT,
5
13
  getState__INTERNAL,
@@ -8,12 +16,31 @@ import {
8
16
  } from "."
9
17
  import type {
10
18
  AtomToken,
19
+ FamilyMetadata,
20
+ ReadonlySelectorOptions,
11
21
  ReadonlyValueToken,
22
+ SelectorOptions,
12
23
  SelectorToken,
13
24
  StateToken,
14
25
  } from ".."
15
26
  import type { Transactors } from "../transaction"
16
27
 
28
+ export type Selector<T> = {
29
+ key: string
30
+ type: `selector`
31
+ family?: FamilyMetadata
32
+ subject: Rx.Subject<{ newValue: T; oldValue: T }>
33
+ get: () => T
34
+ set: (newValue: T | ((oldValue: T) => T)) => void
35
+ }
36
+ export type ReadonlySelector<T> = {
37
+ key: string
38
+ type: `readonly_selector`
39
+ family?: FamilyMetadata
40
+ subject: Rx.Subject<{ newValue: T; oldValue: T }>
41
+ get: () => T
42
+ }
43
+
17
44
  export const lookupSelectorSources = (
18
45
  key: string,
19
46
  store: Store
@@ -22,8 +49,8 @@ export const lookupSelectorSources = (
22
49
  | ReadonlyValueToken<unknown>
23
50
  | SelectorToken<unknown>
24
51
  )[] =>
25
- store.selectorGraph
26
- .getRelations(key)
52
+ target(store)
53
+ .selectorGraph.getRelations(key)
27
54
  .filter(({ source }) => source !== key)
28
55
  .map(({ source }) => lookup(source, store))
29
56
 
@@ -73,17 +100,21 @@ export const updateSelectorAtoms = (
73
100
  dependency: ReadonlyValueToken<unknown> | StateToken<unknown>,
74
101
  store: Store
75
102
  ): void => {
103
+ const core = target(store)
76
104
  if (dependency.type === `atom`) {
77
- store.selectorAtoms = store.selectorAtoms.set(selectorKey, dependency.key)
105
+ core.selectorAtoms = core.selectorAtoms.set(selectorKey, dependency.key)
78
106
  store.config.logger?.info(
79
107
  ` || adding root for "${selectorKey}": ${dependency.key}`
80
108
  )
81
109
  return
82
110
  }
83
111
  const roots = traceSelectorAtoms(selectorKey, dependency, store)
84
- store.config.logger?.info(` || adding roots for "${selectorKey}":`, roots)
112
+ store.config.logger?.info(
113
+ ` || adding roots for "${selectorKey}":`,
114
+ roots.map((r) => r.key)
115
+ )
85
116
  for (const root of roots) {
86
- store.selectorAtoms = store.selectorAtoms.set(selectorKey, root.key)
117
+ core.selectorAtoms = core.selectorAtoms.set(selectorKey, root.key)
87
118
  }
88
119
  }
89
120
 
@@ -92,7 +123,8 @@ export const registerSelector = (
92
123
  store: Store = IMPLICIT.STORE
93
124
  ): Transactors => ({
94
125
  get: (dependency) => {
95
- const alreadyRegistered = store.selectorGraph
126
+ const core = target(store)
127
+ const alreadyRegistered = core.selectorGraph
96
128
  .getRelations(selectorKey)
97
129
  .some(({ source }) => source === dependency.key)
98
130
 
@@ -106,16 +138,13 @@ export const registerSelector = (
106
138
  )
107
139
  } else {
108
140
  store.config.logger?.info(
109
- `🔌 registerSelector "${selectorKey}" <- "${dependency.key}" =`,
110
- dependencyValue
111
- )
112
- store.selectorGraph = store.selectorGraph.set(
113
- selectorKey,
114
- dependency.key,
115
- {
116
- source: dependency.key,
117
- }
141
+ `🔌 registerSelector "${selectorKey}" <- ( "${dependency.key}" =`,
142
+ dependencyValue,
143
+ `)`
118
144
  )
145
+ core.selectorGraph = core.selectorGraph.set(selectorKey, dependency.key, {
146
+ source: dependency.key,
147
+ })
119
148
  }
120
149
  updateSelectorAtoms(selectorKey, dependency, store)
121
150
  return dependencyValue
@@ -125,3 +154,75 @@ export const registerSelector = (
125
154
  setState__INTERNAL(state, newValue, store)
126
155
  },
127
156
  })
157
+
158
+ export function selector__INTERNAL<T>(
159
+ options: SelectorOptions<T>,
160
+ family?: FamilyMetadata,
161
+ store?: Store
162
+ ): SelectorToken<T>
163
+ export function selector__INTERNAL<T>(
164
+ options: ReadonlySelectorOptions<T>,
165
+ family?: FamilyMetadata,
166
+ store?: Store
167
+ ): ReadonlyValueToken<T>
168
+ export function selector__INTERNAL<T>(
169
+ options: ReadonlySelectorOptions<T> | SelectorOptions<T>,
170
+ family?: FamilyMetadata,
171
+ store: Store = IMPLICIT.STORE
172
+ ): ReadonlyValueToken<T> | SelectorToken<T> {
173
+ const core = target(store)
174
+ if (HAMT.has(options.key, core.selectors)) {
175
+ store.config.logger?.error(
176
+ `Key "${options.key}" already exists in the store.`
177
+ )
178
+ }
179
+
180
+ const subject = new Rx.Subject<{ newValue: T; oldValue: T }>()
181
+
182
+ const { get, set } = registerSelector(options.key, store)
183
+ const getSelf = () => {
184
+ const value = options.get({ get })
185
+ cacheValue(options.key, value, store)
186
+ return value
187
+ }
188
+ if (!(`set` in options)) {
189
+ const readonlySelector: ReadonlySelector<T> = {
190
+ ...options,
191
+ subject,
192
+ get: getSelf,
193
+ type: `readonly_selector`,
194
+ ...(family && { family }),
195
+ }
196
+ core.readonlySelectors = HAMT.set(
197
+ options.key,
198
+ readonlySelector,
199
+ core.readonlySelectors
200
+ )
201
+ const initialValue = getSelf()
202
+ store.config.logger?.info(` ✨ "${options.key}" =`, initialValue)
203
+ return { ...readonlySelector, type: `readonly_selector` }
204
+ }
205
+ const setSelf = (next: T | ((oldValue: T) => T)): void => {
206
+ store.config.logger?.info(` <- "${options.key}" became`, next)
207
+ const oldValue = getSelf()
208
+ const newValue = become(next)(oldValue)
209
+ cacheValue(options.key, newValue, store)
210
+ markDone(options.key, store)
211
+ if (store.transactionStatus.phase === `idle`) {
212
+ subject.next({ newValue, oldValue })
213
+ }
214
+ options.set({ get, set }, newValue)
215
+ }
216
+ const mySelector: Selector<T> = {
217
+ ...options,
218
+ subject,
219
+ get: getSelf,
220
+ set: setSelf,
221
+ type: `selector`,
222
+ ...(family && { family }),
223
+ }
224
+ core.selectors = HAMT.set(options.key, mySelector, core.selectors)
225
+ const initialValue = getSelf()
226
+ store.config.logger?.info(` ✨ "${options.key}" =`, initialValue)
227
+ return { ...mySelector, type: `selector` }
228
+ }
@@ -2,25 +2,34 @@ import HAMT from "hamt_plus"
2
2
 
3
3
  import { become } from "~/packages/anvl/src/function"
4
4
 
5
- import type { Atom, Selector } from "."
6
- import { isAtomDefault } from "."
7
- import { getState__INTERNAL } from "./get"
8
- import { isDone, markDone } from "./operation"
9
- import type { Store } from "./store"
10
- import { IMPLICIT } from "./store"
5
+ import type { Atom, Selector, Store } from "."
6
+ import {
7
+ IMPLICIT,
8
+ cacheValue,
9
+ emitUpdate,
10
+ evictCachedValue,
11
+ getState__INTERNAL,
12
+ isAtomDefault,
13
+ isDone,
14
+ markAtomAsNotDefault,
15
+ markDone,
16
+ stowUpdate,
17
+ target,
18
+ } from "."
11
19
 
12
20
  export const evictDownStream = <T>(
13
21
  state: Atom<T>,
14
22
  store: Store = IMPLICIT.STORE
15
23
  ): void => {
16
- const downstream = store.selectorAtoms.getRelations(state.key)
24
+ const core = target(store)
25
+ const downstream = core.selectorAtoms.getRelations(state.key)
17
26
  const downstreamKeys = downstream.map(({ id }) => id)
18
27
  store.config.logger?.info(
19
28
  ` || ${downstreamKeys.length} downstream:`,
20
29
  downstreamKeys
21
30
  )
22
- if (store.operation.open) {
23
- store.config.logger?.info(` ||`, [...store.operation.done], `already done`)
31
+ if (core.operation.open) {
32
+ store.config.logger?.info(` ||`, [...core.operation.done], `already done`)
24
33
  }
25
34
  downstream.forEach(({ id: stateKey }) => {
26
35
  if (isDone(stateKey, store)) {
@@ -28,15 +37,15 @@ export const evictDownStream = <T>(
28
37
  return
29
38
  }
30
39
  const state =
31
- HAMT.get(stateKey, store.selectors) ??
32
- HAMT.get(stateKey, store.readonlySelectors)
40
+ HAMT.get(stateKey, core.selectors) ??
41
+ HAMT.get(stateKey, core.readonlySelectors)
33
42
  if (!state) {
34
43
  store.config.logger?.info(
35
44
  ` || ${stateKey} is an atom, and can't be downstream`
36
45
  )
37
46
  return
38
47
  }
39
- store.valueMap = HAMT.remove(stateKey, store.valueMap)
48
+ evictCachedValue(stateKey, store)
40
49
  store.config.logger?.info(` xx evicted "${stateKey}"`)
41
50
 
42
51
  markDone(stateKey, store)
@@ -50,17 +59,22 @@ export const setAtomState = <T>(
50
59
  ): void => {
51
60
  const oldValue = getState__INTERNAL(atom, store)
52
61
  const newValue = become(next)(oldValue)
53
- store.config.logger?.info(`-> setting atom "${atom.key}" to`, newValue)
54
- store.valueMap = HAMT.set(atom.key, newValue, store.valueMap)
62
+ store.config.logger?.info(`<< setting atom "${atom.key}" to`, newValue)
63
+ cacheValue(atom.key, newValue, store)
55
64
  if (isAtomDefault(atom.key)) {
56
- store.atomsAreDefault = HAMT.set(atom.key, false, store.atomsAreDefault)
65
+ markAtomAsNotDefault(atom.key, store)
57
66
  }
58
67
  markDone(atom.key, store)
59
68
  store.config.logger?.info(
60
69
  ` || evicting caches downstream from "${atom.key}"`
61
70
  )
62
71
  evictDownStream(atom, store)
63
- atom.subject.next({ newValue, oldValue })
72
+ const update = { oldValue, newValue }
73
+ if (store.transactionStatus.phase !== `building`) {
74
+ emitUpdate(atom, update, store)
75
+ } else {
76
+ stowUpdate(atom, update, store)
77
+ }
64
78
  }
65
79
  export const setSelectorState = <T>(
66
80
  selector: Selector<T>,
@@ -70,7 +84,7 @@ export const setSelectorState = <T>(
70
84
  const oldValue = getState__INTERNAL(selector, store)
71
85
  const newValue = become(next)(oldValue)
72
86
 
73
- store.config.logger?.info(`-> setting selector "${selector.key}" to`, newValue)
87
+ store.config.logger?.info(`<< setting selector "${selector.key}" to`, newValue)
74
88
  store.config.logger?.info(` || propagating change made to "${selector.key}"`)
75
89
 
76
90
  selector.set(newValue)
@@ -1,66 +1,84 @@
1
1
  import type { Hamt } from "hamt_plus"
2
2
  import HAMT from "hamt_plus"
3
3
 
4
+ import { doNothing } from "~/packages/anvl/src/function"
4
5
  import { Join } from "~/packages/anvl/src/join"
5
6
 
6
- import type { Atom, ReadonlySelector, Selector } from "."
7
+ import type {
8
+ Atom,
9
+ OperationProgress,
10
+ ReadonlySelector,
11
+ Selector,
12
+ TransactionStatus,
13
+ Timeline,
14
+ TimelineData,
15
+ } from "."
16
+ import type { Logger, Transaction, ƒn } from ".."
17
+
18
+ export type StoreCore = Pick<
19
+ Store,
20
+ | `atoms`
21
+ | `atomsThatAreDefault`
22
+ | `operation`
23
+ | `readonlySelectors`
24
+ | `selectorAtoms`
25
+ | `selectorGraph`
26
+ | `selectors`
27
+ | `timelineAtoms`
28
+ | `timelines`
29
+ | `transactions`
30
+ | `valueMap`
31
+ >
7
32
 
8
33
  export interface Store {
9
- valueMap: Hamt<any, string>
10
- selectorGraph: Join<{ source: string }>
11
- selectorAtoms: Join
12
34
  atoms: Hamt<Atom<any>, string>
13
- atomsAreDefault: Hamt<boolean, string>
14
- selectors: Hamt<Selector<any>, string>
35
+ atomsThatAreDefault: Set<string>
15
36
  readonlySelectors: Hamt<ReadonlySelector<any>, string>
16
- operation:
17
- | {
18
- open: false
19
- }
20
- | {
21
- open: true
22
- done: Set<string>
23
- prev: Hamt<any, string>
24
- }
25
- transaction:
26
- | {
27
- open: false
28
- }
29
- | {
30
- open: true
31
- prev: Pick<
32
- Store,
33
- | `atoms`
34
- | `readonlySelectors`
35
- | `selectorGraph`
36
- | `selectors`
37
- | `valueMap`
38
- >
39
- }
37
+ selectorAtoms: Join
38
+ selectorGraph: Join<{ source: string }>
39
+ selectors: Hamt<Selector<any>, string>
40
+ timelines: Hamt<Timeline, string>
41
+ timelineAtoms: Join
42
+ timelineStore: Hamt<TimelineData, string>
43
+ transactions: Hamt<Transaction<any>, string>
44
+ valueMap: Hamt<any, string>
45
+
46
+ operation: OperationProgress
47
+ transactionStatus: TransactionStatus<ƒn>
40
48
  config: {
41
49
  name: string
42
- logger: Pick<Console, `error` | `info` | `warn`> | null
50
+ logger: Logger | null
51
+ logger__INTERNAL: Logger
43
52
  }
44
53
  }
45
54
 
46
55
  export const createStore = (name: string): Store =>
47
56
  ({
48
- valueMap: HAMT.make<any, string>(),
49
- selectorGraph: new Join({ relationType: `n:n` }),
50
- selectorAtoms: new Join({ relationType: `n:n` }),
51
57
  atoms: HAMT.make<Atom<any>, string>(),
52
- atomsAreDefault: HAMT.make<boolean, string>(),
53
- selectors: HAMT.make<Selector<any>, string>(),
58
+ atomsThatAreDefault: new Set(),
54
59
  readonlySelectors: HAMT.make<ReadonlySelector<any>, string>(),
60
+ selectorAtoms: new Join({ relationType: `n:n` }),
61
+ selectorGraph: new Join({ relationType: `n:n` }),
62
+ selectors: HAMT.make<Selector<any>, string>(),
63
+ timelines: HAMT.make<Timeline, string>(),
64
+ timelineAtoms: new Join({ relationType: `1:n` }),
65
+ timelineStore: HAMT.make<TimelineData, string>(),
66
+ transactions: HAMT.make<Transaction<any>, string>(),
67
+ valueMap: HAMT.make<any, string>(),
68
+
55
69
  operation: {
56
70
  open: false,
57
71
  },
58
- transaction: {
59
- open: false,
72
+ transactionStatus: {
73
+ phase: `idle`,
60
74
  },
61
75
  config: {
62
76
  name,
63
- logger: null,
77
+ logger: {
78
+ ...console,
79
+ info: doNothing,
80
+ },
81
+ logger__INTERNAL: console,
64
82
  },
65
83
  } satisfies Store)
66
84
 
@@ -70,12 +88,6 @@ export const IMPLICIT = {
70
88
  return this.STORE_INTERNAL ?? (this.STORE_INTERNAL = createStore(`DEFAULT`))
71
89
  },
72
90
  }
73
- export const configure = (
74
- config: Partial<Store[`config`]>,
75
- store: Store = IMPLICIT.STORE
76
- ): void => {
77
- Object.assign(store.config, config)
78
- }
79
91
 
80
92
  export const clearStore = (store: Store = IMPLICIT.STORE): void => {
81
93
  const { config } = store