valdres 1.0.0-beta.16 → 1.0.0-beta.17
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/dist/adapter-internals/v1.js +47 -0
- package/dist/chunk-24w014gs.js +5878 -0
- package/dist/index.js +572 -3799
- package/dist/types/adapter-internals/v1.d.ts +3 -0
- package/dist/types/atomFamily.d.ts +3 -3
- package/dist/types/errors/StoreDisposedError.d.ts +4 -0
- package/dist/types/globalStore.d.ts +1 -0
- package/dist/types/index.d.ts +6 -3
- package/dist/types/indexConstructor.d.ts +13 -3
- package/dist/types/lib/WeakSelectorCache.d.ts +36 -0
- package/dist/types/lib/WeakValueMap.d.ts +40 -0
- package/dist/types/lib/adapterTransaction.d.ts +10 -0
- package/dist/types/lib/architectureInstrumentation.d.ts +30 -0
- package/dist/types/lib/asyncDependencyTracking.d.ts +0 -2
- package/dist/types/lib/atomFamilyIndex.d.ts +17 -10
- package/dist/types/lib/commitErrors.d.ts +7 -0
- package/dist/types/lib/coordinateAsyncWrite.d.ts +11 -0
- package/dist/types/lib/createAtomFamily.d.ts +2 -2
- package/dist/types/lib/createGlobalAtomFamily.d.ts +2 -2
- package/dist/types/lib/disposeStoreData.d.ts +7 -0
- package/dist/types/lib/familyKey.d.ts +1 -1
- package/dist/types/lib/finishAtomSet.d.ts +9 -0
- package/dist/types/lib/getState.d.ts +1 -1
- package/dist/types/lib/getStoreData.d.ts +4 -0
- package/dist/types/lib/getStoreRuntime.d.ts +4 -0
- package/dist/types/lib/globalAtom.d.ts +2 -2
- package/dist/types/lib/globalAtomFanOut.d.ts +21 -0
- package/dist/types/lib/globalOnSetMarker.d.ts +3 -0
- package/dist/types/lib/inheritedDependencyBranches.d.ts +21 -0
- package/dist/types/lib/initSelector.d.ts +18 -4
- package/dist/types/lib/mountAtom.d.ts +10 -3
- package/dist/types/lib/namedStateIndex.d.ts +11 -0
- package/dist/types/lib/nativeAsyncSelectorError.d.ts +1 -0
- package/dist/types/lib/noteDependencyGraphChanged.d.ts +4 -0
- package/dist/types/lib/notifyChangeListeners.d.ts +23 -10
- package/dist/types/lib/onCommitEnd.d.ts +4 -1
- package/dist/types/lib/propagateUpdatedAtoms.d.ts +1 -1
- package/dist/types/lib/registerName.d.ts +1 -0
- package/dist/types/lib/setAtoms.d.ts +1 -1
- package/dist/types/lib/stateRevisions.d.ts +22 -0
- package/dist/types/lib/storeAdapter.d.ts +8 -0
- package/dist/types/lib/storeDataAccessToken.d.ts +2 -0
- package/dist/types/lib/storeLifecycle.d.ts +72 -0
- package/dist/types/lib/storeRuntimeKey.d.ts +2 -0
- package/dist/types/lib/stringifyFamilyArgs.d.ts +3 -1
- package/dist/types/lib/subscribe.d.ts +1 -2
- package/dist/types/lib/transaction.d.ts +55 -19
- package/dist/types/lib/unsetValue.d.ts +12 -11
- package/dist/types/lib/unsubscribe.d.ts +2 -2
- package/dist/types/lib/writeAtoms.d.ts +10 -11
- package/dist/types/selectorFamily.d.ts +2 -2
- package/dist/types/types/Atom.d.ts +1 -3
- package/dist/types/types/AtomFamily.d.ts +8 -1
- package/dist/types/types/AtomFamilyAtom.d.ts +1 -1
- package/dist/types/types/AtomFamilyOptions.d.ts +7 -0
- package/dist/types/types/AtomOnSet.d.ts +2 -2
- package/dist/types/types/AtomOptions.d.ts +5 -0
- package/dist/types/types/FamilyKey.d.ts +4 -3
- package/dist/types/types/GetValue.d.ts +1 -1
- package/dist/types/types/GlobalAtom.d.ts +0 -8
- package/dist/types/types/IndexOptions.d.ts +7 -0
- package/dist/types/types/InitializeCallback.d.ts +2 -3
- package/dist/types/types/InternalAtom.d.ts +6 -0
- package/dist/types/types/InternalGlobalAtom.d.ts +15 -0
- package/dist/types/types/Selector.d.ts +2 -0
- package/dist/types/types/SelectorFamily.d.ts +4 -0
- package/dist/types/types/SelectorFamilyOptions.d.ts +7 -0
- package/dist/types/types/SelectorOptions.d.ts +5 -0
- package/dist/types/types/Store.d.ts +19 -12
- package/dist/types/types/StoreChange.d.ts +9 -6
- package/dist/types/types/StoreChangeSource.d.ts +9 -7
- package/dist/types/types/StoreData.d.ts +79 -17
- package/dist/types/types/SubscribeFn.d.ts +4 -4
- package/dist/types/types/Transaction.d.ts +27 -0
- package/dist/types/types/TransactionFn.d.ts +5 -2
- package/dist/types/types/TransactionInterface.d.ts +3 -19
- package/dist/types/utils/dehydrate.d.ts +7 -7
- package/dist/types/utils/isGlobalAtom.d.ts +2 -2
- package/package.json +5 -1
- package/dist/types/lib/stableStringify.d.ts +0 -1
- package/dist/types/types/Family.d.ts +0 -3
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SelectorEvaluationError,
|
|
3
|
+
TransactionContext,
|
|
4
|
+
abortTransaction,
|
|
5
|
+
commitTransaction,
|
|
6
|
+
getStoreData
|
|
7
|
+
} from "../chunk-24w014gs.js";
|
|
8
|
+
|
|
9
|
+
// src/lib/adapterTransaction.ts
|
|
10
|
+
class Transaction extends TransactionContext {
|
|
11
|
+
constructor(store) {
|
|
12
|
+
super(getStoreData(store));
|
|
13
|
+
}
|
|
14
|
+
commit(source) {
|
|
15
|
+
commitTransaction(this, source);
|
|
16
|
+
}
|
|
17
|
+
abort() {
|
|
18
|
+
abortTransaction(this);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
// src/lib/storeAdapter.ts
|
|
22
|
+
var storeAdapter = Object.freeze({
|
|
23
|
+
isBatching(store) {
|
|
24
|
+
return getStoreData(store).batchUpdates === true;
|
|
25
|
+
},
|
|
26
|
+
isEnumerable(store) {
|
|
27
|
+
return getStoreData(store).enumerable === true;
|
|
28
|
+
},
|
|
29
|
+
hasScope(store, scopeId) {
|
|
30
|
+
return getStoreData(store).scopes.has(scopeId);
|
|
31
|
+
},
|
|
32
|
+
hasScopePath(store, scopeIds) {
|
|
33
|
+
let data = getStoreData(store);
|
|
34
|
+
for (const scopeId of scopeIds) {
|
|
35
|
+
const scope = data.scopes.get(scopeId);
|
|
36
|
+
if (!scope)
|
|
37
|
+
return false;
|
|
38
|
+
data = scope;
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
storeAdapter,
|
|
45
|
+
Transaction,
|
|
46
|
+
SelectorEvaluationError
|
|
47
|
+
};
|