atom.io 0.11.0 → 0.12.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/data/dist/index.cjs +614 -0
- package/data/dist/index.cjs.map +1 -0
- package/data/dist/index.d.cts +158 -0
- package/data/dist/index.d.ts +118 -1
- package/data/dist/index.js +551 -30
- package/data/dist/index.js.map +1 -1
- package/data/dist/metafile-cjs.json +1 -0
- package/data/dist/metafile-esm.json +1 -0
- package/data/package.json +4 -3
- package/data/src/index.ts +1 -0
- package/data/src/join.ts +450 -0
- package/data/src/struct-family.ts +34 -24
- package/data/src/struct.ts +6 -8
- package/dist/index.cjs +257 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{index.d.mts → index.d.cts} +10 -11
- package/dist/index.d.ts +10 -11
- package/dist/index.js +63 -104
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/internal/dist/{index.mjs → index.cjs} +716 -495
- package/internal/dist/index.cjs.map +1 -0
- package/internal/dist/{index.d.mts → index.d.cts} +124 -105
- package/internal/dist/index.d.ts +124 -105
- package/internal/dist/index.js +651 -555
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/metafile-cjs.json +1 -0
- package/internal/dist/metafile-esm.json +1 -0
- package/internal/package.json +4 -3
- package/internal/src/atom/create-atom.ts +29 -16
- package/internal/src/atom/delete-atom.ts +25 -6
- package/internal/src/atom/is-default.ts +4 -17
- package/internal/src/caching.ts +28 -23
- package/internal/src/families/create-atom-family.ts +3 -2
- package/internal/src/families/create-readonly-selector-family.ts +1 -1
- package/internal/src/families/create-selector-family.ts +4 -4
- package/internal/src/index.ts +4 -2
- package/internal/src/lazy-map.ts +33 -0
- package/internal/src/mutable/create-mutable-atom-family.ts +2 -2
- package/internal/src/mutable/create-mutable-atom.ts +1 -2
- package/internal/src/mutable/get-json-family.ts +22 -0
- package/internal/src/mutable/get-json-token.ts +1 -0
- package/internal/src/mutable/index.ts +1 -0
- package/internal/src/mutable/tracker-family.ts +1 -2
- package/internal/src/mutable/tracker.ts +8 -6
- package/internal/src/mutable/transceiver.ts +2 -0
- package/internal/src/not-found-error.ts +27 -0
- package/internal/src/operation.ts +2 -3
- package/internal/src/{get-state-internal.ts → read-or-compute-value.ts} +13 -6
- package/internal/src/selector/create-selector.ts +6 -7
- package/internal/src/selector/delete-selector.ts +37 -0
- package/internal/src/selector/index.ts +2 -1
- package/internal/src/selector/register-selector.ts +7 -7
- package/internal/src/set-state/copy-mutable-in-transaction.ts +3 -2
- package/internal/src/set-state/emit-update.ts +1 -3
- package/internal/src/set-state/evict-downstream.ts +6 -8
- package/internal/src/set-state/index.ts +1 -1
- package/internal/src/set-state/{set-state-internal.ts → set-atom-or-selector.ts} +2 -3
- package/internal/src/set-state/set-atom.ts +5 -6
- package/internal/src/store/store.ts +1 -1
- package/internal/src/store/withdraw-new-family-member.ts +6 -6
- package/internal/src/subscribe/recall-state.ts +1 -2
- package/internal/src/subscribe/subscribe-to-root-atoms.ts +2 -2
- package/internal/src/timeline/add-atom-to-timeline.ts +5 -16
- package/internal/src/timeline/{timeline-internal.ts → create-timeline.ts} +4 -5
- package/internal/src/timeline/index.ts +2 -2
- package/internal/src/timeline/time-travel.ts +89 -0
- package/internal/src/transaction/build-transaction.ts +8 -7
- package/internal/src/transaction/{transaction-internal.ts → create-transaction.ts} +6 -5
- package/internal/src/transaction/index.ts +2 -3
- package/introspection/dist/{index.mjs → index.cjs} +54 -29
- package/introspection/dist/index.cjs.map +1 -0
- package/introspection/dist/{index.d.mts → index.d.cts} +2 -2
- package/introspection/dist/index.d.ts +2 -2
- package/introspection/dist/index.js +32 -49
- package/introspection/dist/index.js.map +1 -1
- package/introspection/dist/metafile-cjs.json +1 -0
- package/introspection/dist/metafile-esm.json +1 -0
- package/introspection/package.json +4 -3
- package/introspection/src/attach-introspection-states.ts +2 -2
- package/introspection/src/attach-selector-index.ts +8 -4
- package/json/dist/{index.mjs → index.cjs} +20 -7
- package/json/dist/{index.mjs.map → index.cjs.map} +1 -1
- package/json/dist/{index.d.mts → index.d.cts} +1 -1
- package/json/dist/index.d.ts +1 -1
- package/json/dist/index.js +6 -19
- package/json/dist/index.js.map +1 -1
- package/json/dist/metafile-cjs.json +1 -0
- package/json/dist/metafile-esm.json +1 -0
- package/json/package.json +4 -3
- package/package.json +48 -47
- package/react/dist/index.cjs +59 -0
- package/react/dist/index.cjs.map +1 -0
- package/react/dist/index.js +20 -42
- package/react/dist/index.js.map +1 -1
- package/react/dist/metafile-cjs.json +1 -0
- package/react/dist/metafile-esm.json +1 -0
- package/react/package.json +4 -3
- package/react/src/store-hooks.ts +8 -2
- package/react-devtools/dist/{index.mjs → index.cjs} +286 -240
- package/react-devtools/dist/index.cjs.map +1 -0
- package/react-devtools/dist/{index.d.mts → index.d.cts} +29 -17
- package/react-devtools/dist/index.d.ts +29 -17
- package/react-devtools/dist/index.js +251 -273
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/metafile-cjs.json +1 -0
- package/react-devtools/dist/metafile-esm.json +1 -0
- package/react-devtools/package.json +4 -3
- package/react-devtools/src/StateEditor.tsx +8 -8
- package/realtime-client/dist/{index.mjs → index.cjs} +50 -21
- package/realtime-client/dist/index.js +20 -49
- package/realtime-client/dist/metafile-cjs.json +1 -0
- package/realtime-client/dist/metafile-esm.json +1 -0
- package/realtime-client/package.json +4 -3
- package/realtime-react/dist/index.cjs +99 -0
- package/realtime-react/dist/index.js +35 -66
- package/realtime-react/dist/metafile-cjs.json +1 -0
- package/realtime-react/dist/metafile-esm.json +1 -0
- package/realtime-react/package.json +4 -3
- package/realtime-server/dist/{index.mjs → index.cjs} +67 -40
- package/realtime-server/dist/index.js +39 -66
- package/realtime-server/dist/metafile-cjs.json +1 -0
- package/realtime-server/dist/metafile-esm.json +1 -0
- package/realtime-server/package.json +4 -3
- package/realtime-testing/dist/{index.mjs → index.cjs} +54 -23
- package/realtime-testing/dist/index.js +22 -53
- package/realtime-testing/dist/metafile-cjs.json +1 -0
- package/realtime-testing/dist/metafile-esm.json +1 -0
- package/realtime-testing/package.json +4 -3
- package/src/atom.ts +6 -8
- package/src/dispose.ts +18 -0
- package/src/get-state.ts +16 -0
- package/src/index.ts +3 -1
- package/src/logger.ts +1 -1
- package/src/selector.ts +3 -3
- package/src/set-state.ts +22 -0
- package/src/silo.ts +7 -8
- package/src/timeline.ts +6 -11
- package/src/transaction.ts +2 -2
- package/transceivers/set-rtx/dist/{index.mjs → index.cjs} +40 -36
- package/transceivers/set-rtx/dist/index.cjs.map +1 -0
- package/transceivers/set-rtx/dist/{index.d.mts → index.d.cts} +2 -1
- package/transceivers/set-rtx/dist/index.d.ts +2 -1
- package/transceivers/set-rtx/dist/index.js +37 -37
- package/transceivers/set-rtx/dist/index.js.map +1 -1
- package/transceivers/set-rtx/dist/metafile-cjs.json +1 -0
- package/transceivers/set-rtx/dist/metafile-esm.json +1 -0
- package/transceivers/set-rtx/package.json +4 -3
- package/transceivers/set-rtx/src/set-rtx.ts +29 -26
- package/data/dist/index.d.mts +0 -41
- package/data/dist/index.mjs +0 -82
- package/data/dist/index.mjs.map +0 -1
- package/dist/index.mjs +0 -215
- package/dist/index.mjs.map +0 -1
- package/internal/dist/index.mjs.map +0 -1
- package/internal/src/set-state/set-selector-state.ts +0 -8
- package/internal/src/timeline/time-travel-internal.ts +0 -109
- package/introspection/dist/index.mjs.map +0 -1
- package/react/dist/index.mjs +0 -29
- package/react/dist/index.mjs.map +0 -1
- package/react-devtools/dist/index.mjs.map +0 -1
- package/realtime-react/dist/index.mjs +0 -68
- package/src/get-set.ts +0 -48
- package/transceivers/set-rtx/dist/index.mjs.map +0 -1
- /package/react/dist/{index.d.mts → index.d.cts} +0 -0
- /package/realtime-client/dist/{index.mjs.map → index.cjs.map} +0 -0
- /package/realtime-client/dist/{index.d.mts → index.d.cts} +0 -0
- /package/realtime-react/dist/{index.mjs.map → index.cjs.map} +0 -0
- /package/realtime-react/dist/{index.d.mts → index.d.cts} +0 -0
- /package/realtime-server/dist/{index.mjs.map → index.cjs.map} +0 -0
- /package/realtime-server/dist/{index.d.mts → index.d.cts} +0 -0
- /package/realtime-testing/dist/{index.mjs.map → index.cjs.map} +0 -0
- /package/realtime-testing/dist/{index.d.mts → index.d.cts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/future.ts":{"bytes":813,"imports":[],"format":"esm"},"src/transaction/abort-transaction.ts":{"bytes":466,"imports":[],"format":"esm"},"src/store/deposit.ts":{"bytes":1134,"imports":[],"format":"esm"},"../../rel8/junction/src/junction.ts":{"bytes":10655,"imports":[],"format":"esm"},"../../rel8/junction/src/index.ts":{"bytes":27,"imports":[{"path":"../../rel8/junction/src/junction.ts","kind":"import-statement","original":"./junction"}],"format":"esm"},"src/subject.ts":{"bytes":512,"imports":[],"format":"esm"},"src/store/store.ts":{"bytes":4029,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"../../rel8/junction/src/index.ts","kind":"import-statement","original":"~/packages/rel8/junction/src"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/timeline/add-atom-to-timeline.ts":{"bytes":6248,"imports":[{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/timeline/create-timeline.ts":{"bytes":3193,"imports":[{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"src/timeline/add-atom-to-timeline.ts","kind":"import-statement","original":"./add-atom-to-timeline"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/timeline/time-travel.ts":{"bytes":2019,"imports":[{"path":"atom.io","kind":"import-statement","external":true}],"format":"esm"},"src/timeline/index.ts":{"bytes":103,"imports":[{"path":"src/timeline/add-atom-to-timeline.ts","kind":"import-statement","original":"./add-atom-to-timeline"},{"path":"src/timeline/create-timeline.ts","kind":"import-statement","original":"./create-timeline"},{"path":"src/timeline/time-travel.ts","kind":"import-statement","original":"./time-travel"}],"format":"esm"},"src/store/withdraw.ts":{"bytes":3153,"imports":[{"path":"src/timeline/index.ts","kind":"import-statement","original":"../timeline"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/store/withdraw-new-family-member.ts":{"bytes":1486,"imports":[{"path":"src/index.ts","kind":"import-statement","original":".."},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/store/index.ts":{"bytes":122,"imports":[{"path":"src/store/deposit.ts","kind":"import-statement","original":"./deposit"},{"path":"src/store/store.ts","kind":"import-statement","original":"./store"},{"path":"src/store/withdraw.ts","kind":"import-statement","original":"./withdraw"},{"path":"src/store/withdraw-new-family-member.ts","kind":"import-statement","original":"./withdraw-new-family-member"}],"format":"esm"},"src/transaction/apply-transaction.ts":{"bytes":2281,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"}],"format":"esm"},"src/lazy-map.ts":{"bytes":689,"imports":[],"format":"esm"},"src/transaction/build-transaction.ts":{"bytes":1162,"imports":[{"path":"../../rel8/junction/src/index.ts","kind":"import-statement","original":"~/packages/rel8/junction/src"},{"path":"src/lazy-map.ts","kind":"import-statement","original":"../lazy-map"}],"format":"esm"},"src/transaction/create-transaction.ts":{"bytes":1748,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/transaction/abort-transaction.ts","kind":"import-statement","original":"./abort-transaction"},{"path":"src/transaction/apply-transaction.ts","kind":"import-statement","original":"./apply-transaction"},{"path":"src/transaction/build-transaction.ts","kind":"import-statement","original":"./build-transaction"}],"format":"esm"},"src/transaction/redo-transaction.ts":{"bytes":730,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"}],"format":"esm"},"src/transaction/undo-transaction.ts":{"bytes":774,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"}],"format":"esm"},"src/transaction/index.ts":{"bytes":752,"imports":[{"path":"src/transaction/abort-transaction.ts","kind":"import-statement","original":"./abort-transaction"},{"path":"src/transaction/apply-transaction.ts","kind":"import-statement","original":"./apply-transaction"},{"path":"src/transaction/build-transaction.ts","kind":"import-statement","original":"./build-transaction"},{"path":"src/transaction/create-transaction.ts","kind":"import-statement","original":"./create-transaction"},{"path":"src/transaction/redo-transaction.ts","kind":"import-statement","original":"./redo-transaction"},{"path":"src/transaction/undo-transaction.ts","kind":"import-statement","original":"./undo-transaction"}],"format":"esm"},"src/caching.ts":{"bytes":1798,"imports":[{"path":"src/future.ts","kind":"import-statement","original":"./future"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"./transaction"}],"format":"esm"},"src/mutable/tracker.ts":{"bytes":4910,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"src/atom/index.ts","kind":"import-statement","original":"../atom"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/mutable/create-mutable-atom.ts":{"bytes":1281,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"src/atom/index.ts","kind":"import-statement","original":"../atom"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"src/mutable/tracker.ts","kind":"import-statement","original":"./tracker"}],"format":"esm"},"src/families/create-atom-family.ts":{"bytes":1653,"imports":[{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"src/atom/index.ts","kind":"import-statement","original":"../atom"},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/operation.ts":{"bytes":1917,"imports":[{"path":"src/transaction/index.ts","kind":"import-statement","original":"./transaction"}],"format":"esm"},"src/set-state/become.ts":{"bytes":303,"imports":[],"format":"esm"},"src/read-or-compute-value.ts":{"bytes":877,"imports":[{"path":"src/caching.ts","kind":"import-statement","original":"./caching"}],"format":"esm"},"src/set-state/copy-mutable-if-needed.ts":{"bytes":695,"imports":[{"path":"src/mutable/index.ts","kind":"import-statement","original":"../mutable"}],"format":"esm"},"src/set-state/copy-mutable-in-transaction.ts":{"bytes":1484,"imports":[{"path":"..","kind":"import-statement","external":true},{"path":"src/set-state/copy-mutable-if-needed.ts","kind":"import-statement","original":"./copy-mutable-if-needed"}],"format":"esm"},"src/set-state/emit-update.ts":{"bytes":523,"imports":[],"format":"esm"},"src/set-state/evict-downstream.ts":{"bytes":911,"imports":[{"path":"src/caching.ts","kind":"import-statement","original":"../caching"},{"path":"src/operation.ts","kind":"import-statement","original":"../operation"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/set-state/stow-update.ts":{"bytes":1223,"imports":[{"path":"src/mutable/index.ts","kind":"import-statement","original":"../mutable"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/set-state/set-atom.ts":{"bytes":1234,"imports":[{"path":"src/atom/index.ts","kind":"import-statement","original":"../atom"},{"path":"src/caching.ts","kind":"import-statement","original":"../caching"},{"path":"src/operation.ts","kind":"import-statement","original":"../operation"},{"path":"src/read-or-compute-value.ts","kind":"import-statement","original":"../read-or-compute-value"},{"path":"src/set-state/become.ts","kind":"import-statement","original":"./become"},{"path":"src/set-state/copy-mutable-in-transaction.ts","kind":"import-statement","original":"./copy-mutable-in-transaction"},{"path":"src/set-state/emit-update.ts","kind":"import-statement","original":"./emit-update"},{"path":"src/set-state/evict-downstream.ts","kind":"import-statement","original":"./evict-downstream"},{"path":"src/set-state/stow-update.ts","kind":"import-statement","original":"./stow-update"}],"format":"esm"},"src/set-state/set-atom-or-selector.ts":{"bytes":386,"imports":[{"path":"src/set-state/set-atom.ts","kind":"import-statement","original":"./set-atom"}],"format":"esm"},"src/set-state/index.ts":{"bytes":64,"imports":[{"path":"src/set-state/become.ts","kind":"import-statement","original":"./become"},{"path":"src/set-state/set-atom-or-selector.ts","kind":"import-statement","original":"./set-atom-or-selector"}],"format":"esm"},"src/keys.ts":{"bytes":967,"imports":[{"path":"src/transaction/index.ts","kind":"import-statement","original":"./transaction"}],"format":"esm"},"src/selector/get-selector-dependency-keys.ts":{"bytes":600,"imports":[{"path":"src/keys.ts","kind":"import-statement","original":"../keys"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/selector/trace-selector-atoms.ts":{"bytes":1467,"imports":[{"path":"src/keys.ts","kind":"import-statement","original":"../keys"},{"path":"src/selector/get-selector-dependency-keys.ts","kind":"import-statement","original":"./get-selector-dependency-keys"}],"format":"esm"},"src/selector/update-selector-atoms.ts":{"bytes":1003,"imports":[{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"src/selector/trace-selector-atoms.ts","kind":"import-statement","original":"./trace-selector-atoms"}],"format":"esm"},"src/selector/register-selector.ts":{"bytes":1750,"imports":[{"path":"src/read-or-compute-value.ts","kind":"import-statement","original":"../read-or-compute-value"},{"path":"src/set-state/index.ts","kind":"import-statement","original":"../set-state"},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/transaction/create-transaction.ts","kind":"import-statement","original":"../transaction/create-transaction"},{"path":"src/selector/update-selector-atoms.ts","kind":"import-statement","original":"./update-selector-atoms"}],"format":"esm"},"src/selector/create-read-write-selector.ts":{"bytes":1964,"imports":[{"path":"src/caching.ts","kind":"import-statement","original":"../caching"},{"path":"src/operation.ts","kind":"import-statement","original":"../operation"},{"path":"src/set-state/become.ts","kind":"import-statement","original":"../set-state/become"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/selector/create-selector.ts","kind":"import-statement","original":"./create-selector"},{"path":"src/selector/register-selector.ts","kind":"import-statement","original":"./register-selector"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/selector/create-readonly-selector.ts":{"bytes":1424,"imports":[{"path":"src/caching.ts","kind":"import-statement","original":"../caching"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/selector/create-selector.ts","kind":"import-statement","original":"./create-selector"},{"path":"src/selector/register-selector.ts","kind":"import-statement","original":"./register-selector"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/selector/create-selector.ts":{"bytes":1906,"imports":[{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"src/selector/create-read-write-selector.ts","kind":"import-statement","original":"./create-read-write-selector"},{"path":"src/selector/create-readonly-selector.ts","kind":"import-statement","original":"./create-readonly-selector"}],"format":"esm"},"src/selector/delete-selector.ts":{"bytes":1064,"imports":[{"path":"src/index.ts","kind":"import-statement","original":".."}],"format":"esm"},"src/selector/index.ts":{"bytes":230,"imports":[{"path":"src/selector/create-selector.ts","kind":"import-statement","original":"./create-selector"},{"path":"src/selector/delete-selector.ts","kind":"import-statement","original":"./delete-selector"},{"path":"src/selector/get-selector-dependency-keys.ts","kind":"import-statement","original":"./get-selector-dependency-keys"},{"path":"src/selector/register-selector.ts","kind":"import-statement","original":"./register-selector"},{"path":"src/selector/trace-selector-atoms.ts","kind":"import-statement","original":"./trace-selector-atoms"},{"path":"src/selector/update-selector-atoms.ts","kind":"import-statement","original":"./update-selector-atoms"}],"format":"esm"},"src/families/create-readonly-selector-family.ts":{"bytes":1241,"imports":[{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"src/selector/index.ts","kind":"import-statement","original":"../selector"},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/families/create-selector-family.ts":{"bytes":1936,"imports":[{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"src/selector/index.ts","kind":"import-statement","original":"../selector"},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"src/families/create-readonly-selector-family.ts","kind":"import-statement","original":"./create-readonly-selector-family"}],"format":"esm"},"src/families/index.ts":{"bytes":128,"imports":[{"path":"src/families/create-atom-family.ts","kind":"import-statement","original":"./create-atom-family"},{"path":"src/families/create-readonly-selector-family.ts","kind":"import-statement","original":"./create-readonly-selector-family"},{"path":"src/families/create-selector-family.ts","kind":"import-statement","original":"./create-selector-family"}],"format":"esm"},"src/mutable/tracker-family.ts":{"bytes":1644,"imports":[{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"src/families/index.ts","kind":"import-statement","original":"../families"},{"path":"src/mutable/tracker.ts","kind":"import-statement","original":"./tracker"}],"format":"esm"},"src/mutable/create-mutable-atom-family.ts":{"bytes":852,"imports":[{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"src/index.ts","kind":"import-statement","original":".."},{"path":"src/mutable/tracker-family.ts","kind":"import-statement","original":"./tracker-family"}],"format":"esm"},"src/mutable/get-json-family.ts":{"bytes":733,"imports":[{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/mutable/get-json-token.ts":{"bytes":779,"imports":[],"format":"esm"},"src/mutable/get-update-token.ts":{"bytes":657,"imports":[],"format":"esm"},"src/mutable/is-atom-token-mutable.ts":{"bytes":203,"imports":[],"format":"esm"},"src/mutable/transceiver.ts":{"bytes":3768,"imports":[],"format":"esm"},"src/mutable/index.ts":{"bytes":516,"imports":[{"path":"src/mutable/create-mutable-atom.ts","kind":"import-statement","original":"./create-mutable-atom"},{"path":"src/mutable/create-mutable-atom-family.ts","kind":"import-statement","original":"./create-mutable-atom-family"},{"path":"src/mutable/get-json-family.ts","kind":"import-statement","original":"./get-json-family"},{"path":"src/mutable/get-json-token.ts","kind":"import-statement","original":"./get-json-token"},{"path":"src/mutable/get-update-token.ts","kind":"import-statement","original":"./get-update-token"},{"path":"src/mutable/is-atom-token-mutable.ts","kind":"import-statement","original":"./is-atom-token-mutable"},{"path":"src/mutable/tracker.ts","kind":"import-statement","original":"./tracker"},{"path":"src/mutable/tracker-family.ts","kind":"import-statement","original":"./tracker-family"},{"path":"src/mutable/transceiver.ts","kind":"import-statement","original":"./transceiver"}],"format":"esm"},"src/atom/is-default.ts":{"bytes":860,"imports":[{"path":"src/selector/index.ts","kind":"import-statement","original":"../selector"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/atom/create-atom.ts":{"bytes":2533,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"src/caching.ts","kind":"import-statement","original":"../caching"},{"path":"src/mutable/index.ts","kind":"import-statement","original":"../mutable"},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"src/atom/is-default.ts","kind":"import-statement","original":"./is-default"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/atom/delete-atom.ts":{"bytes":946,"imports":[{"path":"src/index.ts","kind":"import-statement","original":".."}],"format":"esm"},"src/atom/index.ts":{"bytes":89,"imports":[{"path":"src/atom/create-atom.ts","kind":"import-statement","original":"./create-atom"},{"path":"src/atom/delete-atom.ts","kind":"import-statement","original":"./delete-atom"},{"path":"src/atom/is-default.ts","kind":"import-statement","original":"./is-default"}],"format":"esm"},"src/not-found-error.ts":{"bytes":637,"imports":[],"format":"esm"},"src/subscribe/recall-state.ts":{"bytes":564,"imports":[{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/subscribe/subscribe-to-root-atoms.ts":{"bytes":1511,"imports":[{"path":"src/read-or-compute-value.ts","kind":"import-statement","original":"../read-or-compute-value"},{"path":"src/selector/index.ts","kind":"import-statement","original":"../selector"},{"path":"src/subscribe/recall-state.ts","kind":"import-statement","original":"./recall-state"}],"format":"esm"},"src/subscribe/index.ts":{"bytes":42,"imports":[{"path":"src/subscribe/subscribe-to-root-atoms.ts","kind":"import-statement","original":"./subscribe-to-root-atoms"}],"format":"esm"},"src/index.ts":{"bytes":469,"imports":[{"path":"src/atom/index.ts","kind":"import-statement","original":"./atom"},{"path":"src/caching.ts","kind":"import-statement","original":"./caching"},{"path":"src/families/index.ts","kind":"import-statement","original":"./families"},{"path":"src/future.ts","kind":"import-statement","original":"./future"},{"path":"src/keys.ts","kind":"import-statement","original":"./keys"},{"path":"src/lazy-map.ts","kind":"import-statement","original":"./lazy-map"},{"path":"src/mutable/index.ts","kind":"import-statement","original":"./mutable"},{"path":"src/not-found-error.ts","kind":"import-statement","original":"./not-found-error"},{"path":"src/operation.ts","kind":"import-statement","original":"./operation"},{"path":"src/read-or-compute-value.ts","kind":"import-statement","original":"./read-or-compute-value"},{"path":"src/selector/index.ts","kind":"import-statement","original":"./selector"},{"path":"src/set-state/index.ts","kind":"import-statement","original":"./set-state"},{"path":"src/store/index.ts","kind":"import-statement","original":"./store"},{"path":"src/subject.ts","kind":"import-statement","original":"./subject"},{"path":"src/subscribe/index.ts","kind":"import-statement","original":"./subscribe"},{"path":"src/timeline/index.ts","kind":"import-statement","original":"./timeline"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"./transaction"}],"format":"esm"}},"outputs":{"dist/index.cjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":150315},"dist/index.cjs":{"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true}],"exports":["FamilyTracker","Future","IMPLICIT","LazyMap","NotFoundError","Store","Subject","TRANSACTION_PHASES","Tracker","abortTransaction","addAtomToTimeline","applyTransaction","become","buildTransaction","cacheValue","clearStore","closeOperation","createAtom","createAtomFamily","createMutableAtom","createMutableAtomFamily","createReadonlySelectorFamily","createSelector","createSelectorFamily","createTimeline","createTransaction","deleteAtom","deleteSelector","deposit","evictCachedValue","getJsonFamily","getJsonToken","getSelectorDependencyKeys","getUpdateToken","isAtomDefault","isAtomKey","isAtomMutable","isAtomTokenMutable","isDone","isReadonlySelectorKey","isSelectorDefault","isSelectorKey","isStateKey","isTransceiver","isValueCached","markAtomAsDefault","markAtomAsNotDefault","markDone","openOperation","readCachedValue","readOrComputeValue","redoTransactionUpdate","registerSelector","setAtomOrSelector","subscribeToRootAtoms","target","timeTravel","traceAllSelectorAtoms","traceSelectorAtoms","undoTransactionUpdate","updateSelectorAtoms","withdraw","withdrawNewFamilyMember"],"entryPoint":"src/index.ts","inputs":{"src/atom/create-atom.ts":{"bytesInOutput":1937},"src/future.ts":{"bytesInOutput":488},"src/transaction/abort-transaction.ts":{"bytesInOutput":449},"src/transaction/index.ts":{"bytesInOutput":59},"src/transaction/apply-transaction.ts":{"bytesInOutput":2197},"src/store/deposit.ts":{"bytesInOutput":172},"src/store/index.ts":{"bytesInOutput":0},"src/store/store.ts":{"bytesInOutput":3049},"../../rel8/junction/src/junction.ts":{"bytesInOutput":7828},"../../rel8/junction/src/index.ts":{"bytesInOutput":0},"src/subject.ts":{"bytesInOutput":420},"src/timeline/add-atom-to-timeline.ts":{"bytesInOutput":7074},"src/timeline/index.ts":{"bytesInOutput":0},"src/timeline/create-timeline.ts":{"bytesInOutput":2226},"src/timeline/time-travel.ts":{"bytesInOutput":1975},"src/store/withdraw.ts":{"bytesInOutput":2071},"src/store/withdraw-new-family-member.ts":{"bytesInOutput":505},"src/lazy-map.ts":{"bytesInOutput":641},"src/transaction/build-transaction.ts":{"bytesInOutput":1078},"src/transaction/create-transaction.ts":{"bytesInOutput":1128},"src/transaction/redo-transaction.ts":{"bytesInOutput":549},"src/transaction/undo-transaction.ts":{"bytesInOutput":603},"src/caching.ts":{"bytesInOutput":1230},"src/mutable/create-mutable-atom.ts":{"bytesInOutput":806},"src/mutable/tracker.ts":{"bytesInOutput":4210},"src/mutable/index.ts":{"bytesInOutput":51},"src/mutable/create-mutable-atom-family.ts":{"bytesInOutput":295},"src/mutable/tracker-family.ts":{"bytesInOutput":994},"src/families/create-atom-family.ts":{"bytesInOutput":1053},"src/families/index.ts":{"bytesInOutput":0},"src/families/create-readonly-selector-family.ts":{"bytesInOutput":739},"src/operation.ts":{"bytesInOutput":1638},"src/set-state/become.ts":{"bytesInOutput":211},"src/read-or-compute-value.ts":{"bytesInOutput":658},"src/set-state/index.ts":{"bytesInOutput":0},"src/set-state/copy-mutable-if-needed.ts":{"bytesInOutput":487},"src/set-state/copy-mutable-in-transaction.ts":{"bytesInOutput":1065},"src/set-state/emit-update.ts":{"bytesInOutput":270},"src/set-state/evict-downstream.ts":{"bytesInOutput":764},"src/set-state/stow-update.ts":{"bytesInOutput":897},"src/set-state/set-atom.ts":{"bytesInOutput":673},"src/set-state/set-atom-or-selector.ts":{"bytesInOutput":160},"src/keys.ts":{"bytesInOutput":340},"src/selector/get-selector-dependency-keys.ts":{"bytesInOutput":292},"src/selector/trace-selector-atoms.ts":{"bytesInOutput":1115},"src/selector/update-selector-atoms.ts":{"bytesInOutput":777},"src/selector/register-selector.ts":{"bytesInOutput":1462},"src/selector/create-read-write-selector.ts":{"bytesInOutput":1378},"src/selector/create-readonly-selector.ts":{"bytesInOutput":929},"src/selector/create-selector.ts":{"bytesInOutput":679},"src/selector/index.ts":{"bytesInOutput":0},"src/selector/delete-selector.ts":{"bytesInOutput":941},"src/families/create-selector-family.ts":{"bytesInOutput":1000},"src/mutable/get-json-family.ts":{"bytesInOutput":206},"src/mutable/get-json-token.ts":{"bytesInOutput":424},"src/mutable/get-update-token.ts":{"bytesInOutput":319},"src/mutable/is-atom-token-mutable.ts":{"bytesInOutput":81},"src/mutable/transceiver.ts":{"bytesInOutput":148},"src/atom/is-default.ts":{"bytesInOutput":622},"src/atom/index.ts":{"bytesInOutput":0},"src/atom/delete-atom.ts":{"bytesInOutput":940},"src/index.ts":{"bytesInOutput":0},"src/not-found-error.ts":{"bytesInOutput":411},"src/subscribe/recall-state.ts":{"bytesInOutput":346},"src/subscribe/subscribe-to-root-atoms.ts":{"bytesInOutput":1115},"src/subscribe/index.ts":{"bytesInOutput":0}},"bytes":68439}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/future.ts":{"bytes":813,"imports":[],"format":"esm"},"src/transaction/abort-transaction.ts":{"bytes":466,"imports":[],"format":"esm"},"src/store/deposit.ts":{"bytes":1134,"imports":[],"format":"esm"},"../../rel8/junction/src/junction.ts":{"bytes":10655,"imports":[],"format":"esm"},"../../rel8/junction/src/index.ts":{"bytes":27,"imports":[{"path":"../../rel8/junction/src/junction.ts","kind":"import-statement","original":"./junction"}],"format":"esm"},"src/subject.ts":{"bytes":512,"imports":[],"format":"esm"},"src/store/store.ts":{"bytes":4029,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"../../rel8/junction/src/index.ts","kind":"import-statement","original":"~/packages/rel8/junction/src"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/timeline/add-atom-to-timeline.ts":{"bytes":6248,"imports":[{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/timeline/create-timeline.ts":{"bytes":3193,"imports":[{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"src/timeline/add-atom-to-timeline.ts","kind":"import-statement","original":"./add-atom-to-timeline"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/timeline/time-travel.ts":{"bytes":2019,"imports":[{"path":"atom.io","kind":"import-statement","external":true}],"format":"esm"},"src/timeline/index.ts":{"bytes":103,"imports":[{"path":"src/timeline/add-atom-to-timeline.ts","kind":"import-statement","original":"./add-atom-to-timeline"},{"path":"src/timeline/create-timeline.ts","kind":"import-statement","original":"./create-timeline"},{"path":"src/timeline/time-travel.ts","kind":"import-statement","original":"./time-travel"}],"format":"esm"},"src/store/withdraw.ts":{"bytes":3153,"imports":[{"path":"src/timeline/index.ts","kind":"import-statement","original":"../timeline"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/store/withdraw-new-family-member.ts":{"bytes":1486,"imports":[{"path":"src/index.ts","kind":"import-statement","original":".."},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/store/index.ts":{"bytes":122,"imports":[{"path":"src/store/deposit.ts","kind":"import-statement","original":"./deposit"},{"path":"src/store/store.ts","kind":"import-statement","original":"./store"},{"path":"src/store/withdraw.ts","kind":"import-statement","original":"./withdraw"},{"path":"src/store/withdraw-new-family-member.ts","kind":"import-statement","original":"./withdraw-new-family-member"}],"format":"esm"},"src/transaction/apply-transaction.ts":{"bytes":2281,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"}],"format":"esm"},"src/lazy-map.ts":{"bytes":689,"imports":[],"format":"esm"},"src/transaction/build-transaction.ts":{"bytes":1162,"imports":[{"path":"../../rel8/junction/src/index.ts","kind":"import-statement","original":"~/packages/rel8/junction/src"},{"path":"src/lazy-map.ts","kind":"import-statement","original":"../lazy-map"}],"format":"esm"},"src/transaction/create-transaction.ts":{"bytes":1748,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/transaction/abort-transaction.ts","kind":"import-statement","original":"./abort-transaction"},{"path":"src/transaction/apply-transaction.ts","kind":"import-statement","original":"./apply-transaction"},{"path":"src/transaction/build-transaction.ts","kind":"import-statement","original":"./build-transaction"}],"format":"esm"},"src/transaction/redo-transaction.ts":{"bytes":730,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"}],"format":"esm"},"src/transaction/undo-transaction.ts":{"bytes":774,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"}],"format":"esm"},"src/transaction/index.ts":{"bytes":752,"imports":[{"path":"src/transaction/abort-transaction.ts","kind":"import-statement","original":"./abort-transaction"},{"path":"src/transaction/apply-transaction.ts","kind":"import-statement","original":"./apply-transaction"},{"path":"src/transaction/build-transaction.ts","kind":"import-statement","original":"./build-transaction"},{"path":"src/transaction/create-transaction.ts","kind":"import-statement","original":"./create-transaction"},{"path":"src/transaction/redo-transaction.ts","kind":"import-statement","original":"./redo-transaction"},{"path":"src/transaction/undo-transaction.ts","kind":"import-statement","original":"./undo-transaction"}],"format":"esm"},"src/caching.ts":{"bytes":1798,"imports":[{"path":"src/future.ts","kind":"import-statement","original":"./future"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"./transaction"}],"format":"esm"},"src/mutable/tracker.ts":{"bytes":4910,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"src/atom/index.ts","kind":"import-statement","original":"../atom"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/mutable/create-mutable-atom.ts":{"bytes":1281,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"src/atom/index.ts","kind":"import-statement","original":"../atom"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"src/mutable/tracker.ts","kind":"import-statement","original":"./tracker"}],"format":"esm"},"src/families/create-atom-family.ts":{"bytes":1653,"imports":[{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"src/atom/index.ts","kind":"import-statement","original":"../atom"},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/operation.ts":{"bytes":1917,"imports":[{"path":"src/transaction/index.ts","kind":"import-statement","original":"./transaction"}],"format":"esm"},"src/set-state/become.ts":{"bytes":303,"imports":[],"format":"esm"},"src/read-or-compute-value.ts":{"bytes":877,"imports":[{"path":"src/caching.ts","kind":"import-statement","original":"./caching"}],"format":"esm"},"src/set-state/copy-mutable-if-needed.ts":{"bytes":695,"imports":[{"path":"src/mutable/index.ts","kind":"import-statement","original":"../mutable"}],"format":"esm"},"src/set-state/copy-mutable-in-transaction.ts":{"bytes":1484,"imports":[{"path":"..","kind":"import-statement","external":true},{"path":"src/set-state/copy-mutable-if-needed.ts","kind":"import-statement","original":"./copy-mutable-if-needed"}],"format":"esm"},"src/set-state/emit-update.ts":{"bytes":523,"imports":[],"format":"esm"},"src/set-state/evict-downstream.ts":{"bytes":911,"imports":[{"path":"src/caching.ts","kind":"import-statement","original":"../caching"},{"path":"src/operation.ts","kind":"import-statement","original":"../operation"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/set-state/stow-update.ts":{"bytes":1223,"imports":[{"path":"src/mutable/index.ts","kind":"import-statement","original":"../mutable"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/set-state/set-atom.ts":{"bytes":1234,"imports":[{"path":"src/atom/index.ts","kind":"import-statement","original":"../atom"},{"path":"src/caching.ts","kind":"import-statement","original":"../caching"},{"path":"src/operation.ts","kind":"import-statement","original":"../operation"},{"path":"src/read-or-compute-value.ts","kind":"import-statement","original":"../read-or-compute-value"},{"path":"src/set-state/become.ts","kind":"import-statement","original":"./become"},{"path":"src/set-state/copy-mutable-in-transaction.ts","kind":"import-statement","original":"./copy-mutable-in-transaction"},{"path":"src/set-state/emit-update.ts","kind":"import-statement","original":"./emit-update"},{"path":"src/set-state/evict-downstream.ts","kind":"import-statement","original":"./evict-downstream"},{"path":"src/set-state/stow-update.ts","kind":"import-statement","original":"./stow-update"}],"format":"esm"},"src/set-state/set-atom-or-selector.ts":{"bytes":386,"imports":[{"path":"src/set-state/set-atom.ts","kind":"import-statement","original":"./set-atom"}],"format":"esm"},"src/set-state/index.ts":{"bytes":64,"imports":[{"path":"src/set-state/become.ts","kind":"import-statement","original":"./become"},{"path":"src/set-state/set-atom-or-selector.ts","kind":"import-statement","original":"./set-atom-or-selector"}],"format":"esm"},"src/keys.ts":{"bytes":967,"imports":[{"path":"src/transaction/index.ts","kind":"import-statement","original":"./transaction"}],"format":"esm"},"src/selector/get-selector-dependency-keys.ts":{"bytes":600,"imports":[{"path":"src/keys.ts","kind":"import-statement","original":"../keys"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/selector/trace-selector-atoms.ts":{"bytes":1467,"imports":[{"path":"src/keys.ts","kind":"import-statement","original":"../keys"},{"path":"src/selector/get-selector-dependency-keys.ts","kind":"import-statement","original":"./get-selector-dependency-keys"}],"format":"esm"},"src/selector/update-selector-atoms.ts":{"bytes":1003,"imports":[{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"src/selector/trace-selector-atoms.ts","kind":"import-statement","original":"./trace-selector-atoms"}],"format":"esm"},"src/selector/register-selector.ts":{"bytes":1750,"imports":[{"path":"src/read-or-compute-value.ts","kind":"import-statement","original":"../read-or-compute-value"},{"path":"src/set-state/index.ts","kind":"import-statement","original":"../set-state"},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/transaction/create-transaction.ts","kind":"import-statement","original":"../transaction/create-transaction"},{"path":"src/selector/update-selector-atoms.ts","kind":"import-statement","original":"./update-selector-atoms"}],"format":"esm"},"src/selector/create-read-write-selector.ts":{"bytes":1964,"imports":[{"path":"src/caching.ts","kind":"import-statement","original":"../caching"},{"path":"src/operation.ts","kind":"import-statement","original":"../operation"},{"path":"src/set-state/become.ts","kind":"import-statement","original":"../set-state/become"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/selector/create-selector.ts","kind":"import-statement","original":"./create-selector"},{"path":"src/selector/register-selector.ts","kind":"import-statement","original":"./register-selector"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/selector/create-readonly-selector.ts":{"bytes":1424,"imports":[{"path":"src/caching.ts","kind":"import-statement","original":"../caching"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/selector/create-selector.ts","kind":"import-statement","original":"./create-selector"},{"path":"src/selector/register-selector.ts","kind":"import-statement","original":"./register-selector"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/selector/create-selector.ts":{"bytes":1906,"imports":[{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"src/selector/create-read-write-selector.ts","kind":"import-statement","original":"./create-read-write-selector"},{"path":"src/selector/create-readonly-selector.ts","kind":"import-statement","original":"./create-readonly-selector"}],"format":"esm"},"src/selector/delete-selector.ts":{"bytes":1064,"imports":[{"path":"src/index.ts","kind":"import-statement","original":".."}],"format":"esm"},"src/selector/index.ts":{"bytes":230,"imports":[{"path":"src/selector/create-selector.ts","kind":"import-statement","original":"./create-selector"},{"path":"src/selector/delete-selector.ts","kind":"import-statement","original":"./delete-selector"},{"path":"src/selector/get-selector-dependency-keys.ts","kind":"import-statement","original":"./get-selector-dependency-keys"},{"path":"src/selector/register-selector.ts","kind":"import-statement","original":"./register-selector"},{"path":"src/selector/trace-selector-atoms.ts","kind":"import-statement","original":"./trace-selector-atoms"},{"path":"src/selector/update-selector-atoms.ts","kind":"import-statement","original":"./update-selector-atoms"}],"format":"esm"},"src/families/create-readonly-selector-family.ts":{"bytes":1241,"imports":[{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"src/selector/index.ts","kind":"import-statement","original":"../selector"},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/families/create-selector-family.ts":{"bytes":1936,"imports":[{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"src/selector/index.ts","kind":"import-statement","original":"../selector"},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"src/families/create-readonly-selector-family.ts","kind":"import-statement","original":"./create-readonly-selector-family"}],"format":"esm"},"src/families/index.ts":{"bytes":128,"imports":[{"path":"src/families/create-atom-family.ts","kind":"import-statement","original":"./create-atom-family"},{"path":"src/families/create-readonly-selector-family.ts","kind":"import-statement","original":"./create-readonly-selector-family"},{"path":"src/families/create-selector-family.ts","kind":"import-statement","original":"./create-selector-family"}],"format":"esm"},"src/mutable/tracker-family.ts":{"bytes":1644,"imports":[{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"src/families/index.ts","kind":"import-statement","original":"../families"},{"path":"src/mutable/tracker.ts","kind":"import-statement","original":"./tracker"}],"format":"esm"},"src/mutable/create-mutable-atom-family.ts":{"bytes":852,"imports":[{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"src/index.ts","kind":"import-statement","original":".."},{"path":"src/mutable/tracker-family.ts","kind":"import-statement","original":"./tracker-family"}],"format":"esm"},"src/mutable/get-json-family.ts":{"bytes":733,"imports":[{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/mutable/get-json-token.ts":{"bytes":779,"imports":[],"format":"esm"},"src/mutable/get-update-token.ts":{"bytes":657,"imports":[],"format":"esm"},"src/mutable/is-atom-token-mutable.ts":{"bytes":203,"imports":[],"format":"esm"},"src/mutable/transceiver.ts":{"bytes":3768,"imports":[],"format":"esm"},"src/mutable/index.ts":{"bytes":516,"imports":[{"path":"src/mutable/create-mutable-atom.ts","kind":"import-statement","original":"./create-mutable-atom"},{"path":"src/mutable/create-mutable-atom-family.ts","kind":"import-statement","original":"./create-mutable-atom-family"},{"path":"src/mutable/get-json-family.ts","kind":"import-statement","original":"./get-json-family"},{"path":"src/mutable/get-json-token.ts","kind":"import-statement","original":"./get-json-token"},{"path":"src/mutable/get-update-token.ts","kind":"import-statement","original":"./get-update-token"},{"path":"src/mutable/is-atom-token-mutable.ts","kind":"import-statement","original":"./is-atom-token-mutable"},{"path":"src/mutable/tracker.ts","kind":"import-statement","original":"./tracker"},{"path":"src/mutable/tracker-family.ts","kind":"import-statement","original":"./tracker-family"},{"path":"src/mutable/transceiver.ts","kind":"import-statement","original":"./transceiver"}],"format":"esm"},"src/atom/is-default.ts":{"bytes":860,"imports":[{"path":"src/selector/index.ts","kind":"import-statement","original":"../selector"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/atom/create-atom.ts":{"bytes":2533,"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"src/caching.ts","kind":"import-statement","original":"../caching"},{"path":"src/mutable/index.ts","kind":"import-statement","original":"../mutable"},{"path":"src/store/index.ts","kind":"import-statement","original":"../store"},{"path":"src/subject.ts","kind":"import-statement","original":"../subject"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"},{"path":"src/atom/is-default.ts","kind":"import-statement","original":"./is-default"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/atom/delete-atom.ts":{"bytes":946,"imports":[{"path":"src/index.ts","kind":"import-statement","original":".."}],"format":"esm"},"src/atom/index.ts":{"bytes":89,"imports":[{"path":"src/atom/create-atom.ts","kind":"import-statement","original":"./create-atom"},{"path":"src/atom/delete-atom.ts","kind":"import-statement","original":"./delete-atom"},{"path":"src/atom/is-default.ts","kind":"import-statement","original":"./is-default"}],"format":"esm"},"src/not-found-error.ts":{"bytes":637,"imports":[],"format":"esm"},"src/subscribe/recall-state.ts":{"bytes":564,"imports":[{"path":"src/transaction/index.ts","kind":"import-statement","original":"../transaction"}],"format":"esm"},"src/subscribe/subscribe-to-root-atoms.ts":{"bytes":1511,"imports":[{"path":"src/read-or-compute-value.ts","kind":"import-statement","original":"../read-or-compute-value"},{"path":"src/selector/index.ts","kind":"import-statement","original":"../selector"},{"path":"src/subscribe/recall-state.ts","kind":"import-statement","original":"./recall-state"}],"format":"esm"},"src/subscribe/index.ts":{"bytes":42,"imports":[{"path":"src/subscribe/subscribe-to-root-atoms.ts","kind":"import-statement","original":"./subscribe-to-root-atoms"}],"format":"esm"},"src/index.ts":{"bytes":469,"imports":[{"path":"src/atom/index.ts","kind":"import-statement","original":"./atom"},{"path":"src/caching.ts","kind":"import-statement","original":"./caching"},{"path":"src/families/index.ts","kind":"import-statement","original":"./families"},{"path":"src/future.ts","kind":"import-statement","original":"./future"},{"path":"src/keys.ts","kind":"import-statement","original":"./keys"},{"path":"src/lazy-map.ts","kind":"import-statement","original":"./lazy-map"},{"path":"src/mutable/index.ts","kind":"import-statement","original":"./mutable"},{"path":"src/not-found-error.ts","kind":"import-statement","original":"./not-found-error"},{"path":"src/operation.ts","kind":"import-statement","original":"./operation"},{"path":"src/read-or-compute-value.ts","kind":"import-statement","original":"./read-or-compute-value"},{"path":"src/selector/index.ts","kind":"import-statement","original":"./selector"},{"path":"src/set-state/index.ts","kind":"import-statement","original":"./set-state"},{"path":"src/store/index.ts","kind":"import-statement","original":"./store"},{"path":"src/subject.ts","kind":"import-statement","original":"./subject"},{"path":"src/subscribe/index.ts","kind":"import-statement","original":"./subscribe"},{"path":"src/timeline/index.ts","kind":"import-statement","original":"./timeline"},{"path":"src/transaction/index.ts","kind":"import-statement","original":"./transaction"}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":150315},"dist/index.js":{"imports":[{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"atom.io","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true},{"path":"atom.io/json","kind":"import-statement","external":true}],"exports":["FamilyTracker","Future","IMPLICIT","LazyMap","NotFoundError","Store","Subject","TRANSACTION_PHASES","Tracker","abortTransaction","addAtomToTimeline","applyTransaction","become","buildTransaction","cacheValue","clearStore","closeOperation","createAtom","createAtomFamily","createMutableAtom","createMutableAtomFamily","createReadonlySelectorFamily","createSelector","createSelectorFamily","createTimeline","createTransaction","deleteAtom","deleteSelector","deposit","evictCachedValue","getJsonFamily","getJsonToken","getSelectorDependencyKeys","getUpdateToken","isAtomDefault","isAtomKey","isAtomMutable","isAtomTokenMutable","isDone","isReadonlySelectorKey","isSelectorDefault","isSelectorKey","isStateKey","isTransceiver","isValueCached","markAtomAsDefault","markAtomAsNotDefault","markDone","openOperation","readCachedValue","readOrComputeValue","redoTransactionUpdate","registerSelector","setAtomOrSelector","subscribeToRootAtoms","target","timeTravel","traceAllSelectorAtoms","traceSelectorAtoms","undoTransactionUpdate","updateSelectorAtoms","withdraw","withdrawNewFamilyMember"],"entryPoint":"src/index.ts","inputs":{"src/atom/create-atom.ts":{"bytesInOutput":1937},"src/future.ts":{"bytesInOutput":488},"src/transaction/abort-transaction.ts":{"bytesInOutput":449},"src/transaction/index.ts":{"bytesInOutput":59},"src/transaction/apply-transaction.ts":{"bytesInOutput":2197},"src/store/deposit.ts":{"bytesInOutput":172},"src/store/index.ts":{"bytesInOutput":0},"src/store/store.ts":{"bytesInOutput":3049},"../../rel8/junction/src/junction.ts":{"bytesInOutput":7828},"../../rel8/junction/src/index.ts":{"bytesInOutput":0},"src/subject.ts":{"bytesInOutput":420},"src/timeline/add-atom-to-timeline.ts":{"bytesInOutput":7074},"src/timeline/index.ts":{"bytesInOutput":0},"src/timeline/create-timeline.ts":{"bytesInOutput":2226},"src/timeline/time-travel.ts":{"bytesInOutput":1975},"src/store/withdraw.ts":{"bytesInOutput":2071},"src/store/withdraw-new-family-member.ts":{"bytesInOutput":505},"src/lazy-map.ts":{"bytesInOutput":641},"src/transaction/build-transaction.ts":{"bytesInOutput":1078},"src/transaction/create-transaction.ts":{"bytesInOutput":1128},"src/transaction/redo-transaction.ts":{"bytesInOutput":549},"src/transaction/undo-transaction.ts":{"bytesInOutput":603},"src/caching.ts":{"bytesInOutput":1230},"src/mutable/create-mutable-atom.ts":{"bytesInOutput":806},"src/mutable/tracker.ts":{"bytesInOutput":4210},"src/mutable/index.ts":{"bytesInOutput":51},"src/mutable/create-mutable-atom-family.ts":{"bytesInOutput":295},"src/mutable/tracker-family.ts":{"bytesInOutput":994},"src/families/create-atom-family.ts":{"bytesInOutput":1053},"src/families/index.ts":{"bytesInOutput":0},"src/families/create-readonly-selector-family.ts":{"bytesInOutput":739},"src/operation.ts":{"bytesInOutput":1638},"src/set-state/become.ts":{"bytesInOutput":211},"src/read-or-compute-value.ts":{"bytesInOutput":658},"src/set-state/index.ts":{"bytesInOutput":0},"src/set-state/copy-mutable-if-needed.ts":{"bytesInOutput":487},"src/set-state/copy-mutable-in-transaction.ts":{"bytesInOutput":1065},"src/set-state/emit-update.ts":{"bytesInOutput":270},"src/set-state/evict-downstream.ts":{"bytesInOutput":764},"src/set-state/stow-update.ts":{"bytesInOutput":897},"src/set-state/set-atom.ts":{"bytesInOutput":673},"src/set-state/set-atom-or-selector.ts":{"bytesInOutput":160},"src/keys.ts":{"bytesInOutput":340},"src/selector/get-selector-dependency-keys.ts":{"bytesInOutput":292},"src/selector/trace-selector-atoms.ts":{"bytesInOutput":1115},"src/selector/update-selector-atoms.ts":{"bytesInOutput":777},"src/selector/register-selector.ts":{"bytesInOutput":1462},"src/selector/create-read-write-selector.ts":{"bytesInOutput":1378},"src/selector/create-readonly-selector.ts":{"bytesInOutput":929},"src/selector/create-selector.ts":{"bytesInOutput":679},"src/selector/index.ts":{"bytesInOutput":0},"src/selector/delete-selector.ts":{"bytesInOutput":941},"src/families/create-selector-family.ts":{"bytesInOutput":1000},"src/mutable/get-json-family.ts":{"bytesInOutput":206},"src/mutable/get-json-token.ts":{"bytesInOutput":424},"src/mutable/get-update-token.ts":{"bytesInOutput":319},"src/mutable/is-atom-token-mutable.ts":{"bytesInOutput":81},"src/mutable/transceiver.ts":{"bytesInOutput":148},"src/atom/is-default.ts":{"bytesInOutput":622},"src/atom/index.ts":{"bytesInOutput":0},"src/atom/delete-atom.ts":{"bytesInOutput":940},"src/index.ts":{"bytesInOutput":0},"src/not-found-error.ts":{"bytesInOutput":411},"src/subscribe/recall-state.ts":{"bytesInOutput":346},"src/subscribe/subscribe-to-root-atoms.ts":{"bytesInOutput":1115},"src/subscribe/index.ts":{"bytesInOutput":0}},"bytes":68439}}}
|
package/internal/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atom.io-internal",
|
|
3
|
+
"type": "module",
|
|
3
4
|
"private": true,
|
|
4
5
|
"main": "dist/index.js",
|
|
5
6
|
"types": "dist/index.d.ts",
|
|
@@ -7,9 +8,9 @@
|
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
10
|
"types": "./dist/index.d.ts",
|
|
10
|
-
"browser": "./dist/index.
|
|
11
|
-
"import": "./dist/index.
|
|
12
|
-
"require": "./dist/index.
|
|
11
|
+
"browser": "./dist/index.js",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -10,7 +10,7 @@ import { setState, subscribe } from "atom.io"
|
|
|
10
10
|
import { cacheValue } from "../caching"
|
|
11
11
|
import { createMutableAtom } from "../mutable"
|
|
12
12
|
import type { Store } from "../store"
|
|
13
|
-
import {
|
|
13
|
+
import { deposit } from "../store"
|
|
14
14
|
import { Subject } from "../subject"
|
|
15
15
|
import { target } from "../transaction"
|
|
16
16
|
import { markAtomAsDefault } from "./is-default"
|
|
@@ -21,13 +21,14 @@ export type Atom<T> = {
|
|
|
21
21
|
family?: FamilyMetadata
|
|
22
22
|
install: (store: Store) => void
|
|
23
23
|
subject: Subject<{ newValue: T; oldValue: T }>
|
|
24
|
-
default: T
|
|
24
|
+
default: T | (() => T)
|
|
25
|
+
cleanup?: () => void
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export function createAtom<T>(
|
|
28
29
|
options: AtomOptions<T> | MutableAtomOptions<any, any>,
|
|
29
|
-
family
|
|
30
|
-
store: Store
|
|
30
|
+
family: FamilyMetadata | undefined,
|
|
31
|
+
store: Store,
|
|
31
32
|
): AtomToken<T> {
|
|
32
33
|
store.logger.info(
|
|
33
34
|
`🔨`,
|
|
@@ -48,13 +49,10 @@ export function createAtom<T>(
|
|
|
48
49
|
return deposit(existing)
|
|
49
50
|
}
|
|
50
51
|
const subject = new Subject<{ newValue: T; oldValue: T }>()
|
|
51
|
-
const newAtom = {
|
|
52
|
+
const newAtom: Atom<T> = {
|
|
52
53
|
...options,
|
|
53
54
|
type: `atom`,
|
|
54
55
|
install: (store: Store) => {
|
|
55
|
-
// store.logger.info(
|
|
56
|
-
// `🛠️ installing atom "${options.key}" in store "${store.config.name}"`,
|
|
57
|
-
// )
|
|
58
56
|
store.logger.info(
|
|
59
57
|
`🛠️`,
|
|
60
58
|
`atom`,
|
|
@@ -68,18 +66,33 @@ export function createAtom<T>(
|
|
|
68
66
|
subject,
|
|
69
67
|
...(family && { family }),
|
|
70
68
|
} as const
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
let initialValue = options.default
|
|
70
|
+
if (options.default instanceof Function) {
|
|
71
|
+
initialValue = options.default()
|
|
72
|
+
}
|
|
73
73
|
core.atoms.set(newAtom.key, newAtom)
|
|
74
74
|
markAtomAsDefault(options.key, store)
|
|
75
75
|
cacheValue(options.key, initialValue, subject, store)
|
|
76
76
|
const token = deposit(newAtom)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
if (options.effects) {
|
|
78
|
+
let effectIndex = 0
|
|
79
|
+
const cleanupFunctions: (() => void)[] = []
|
|
80
|
+
for (const effect of options.effects) {
|
|
81
|
+
const cleanup = effect({
|
|
82
|
+
setSelf: (next) => setState(token, next, store),
|
|
83
|
+
onSet: (handle: UpdateHandler<T>) =>
|
|
84
|
+
subscribe(token, handle, `effect[${effectIndex}]`, store),
|
|
85
|
+
})
|
|
86
|
+
if (cleanup) {
|
|
87
|
+
cleanupFunctions.push(cleanup)
|
|
88
|
+
}
|
|
89
|
+
++effectIndex
|
|
90
|
+
}
|
|
91
|
+
newAtom.cleanup = () => {
|
|
92
|
+
for (const cleanup of cleanupFunctions) {
|
|
93
|
+
cleanup()
|
|
94
|
+
}
|
|
95
|
+
}
|
|
83
96
|
}
|
|
84
97
|
store.subject.atomCreation.next(token)
|
|
85
98
|
return token as AtomToken<T>
|
|
@@ -1,15 +1,34 @@
|
|
|
1
|
-
import type { AtomToken } from "
|
|
1
|
+
import type { AtomToken } from "atom.io"
|
|
2
|
+
|
|
2
3
|
import type { Store } from ".."
|
|
3
|
-
import {
|
|
4
|
+
import { deleteSelector, target } from ".."
|
|
4
5
|
|
|
5
|
-
export function deleteAtom(
|
|
6
|
-
atomToken: AtomToken<unknown>,
|
|
7
|
-
store: Store = IMPLICIT.STORE,
|
|
8
|
-
): void {
|
|
6
|
+
export function deleteAtom(atomToken: AtomToken<unknown>, store: Store): void {
|
|
9
7
|
const core = target(store)
|
|
10
8
|
const { key } = atomToken
|
|
9
|
+
const atom = core.atoms.get(key)
|
|
10
|
+
if (!atom) {
|
|
11
|
+
store.logger.error(
|
|
12
|
+
`❌`,
|
|
13
|
+
`atom`,
|
|
14
|
+
`${key}`,
|
|
15
|
+
`Tried to delete atom, but it does not exist in the store.`,
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
atom?.cleanup?.()
|
|
11
19
|
core.atoms.delete(key)
|
|
12
20
|
core.valueMap.delete(key)
|
|
21
|
+
const selectorKeys = core.selectorAtoms.getRelatedKeys(key)
|
|
22
|
+
if (selectorKeys) {
|
|
23
|
+
for (const selectorKey of selectorKeys) {
|
|
24
|
+
const token =
|
|
25
|
+
core.selectors.get(selectorKey) ??
|
|
26
|
+
core.readonlySelectors.get(selectorKey)
|
|
27
|
+
if (token) {
|
|
28
|
+
deleteSelector(token, store)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
13
32
|
core.selectorAtoms.delete(key)
|
|
14
33
|
core.atomsThatAreDefault.delete(key)
|
|
15
34
|
core.timelineAtoms.delete(key)
|
|
@@ -1,37 +1,24 @@
|
|
|
1
1
|
import { traceAllSelectorAtoms } from "../selector"
|
|
2
2
|
import type { Store } from "../store"
|
|
3
|
-
import { IMPLICIT } from "../store"
|
|
4
3
|
import { target } from "../transaction"
|
|
5
4
|
|
|
6
|
-
export const isAtomDefault = (
|
|
7
|
-
key: string,
|
|
8
|
-
store: Store = IMPLICIT.STORE,
|
|
9
|
-
): boolean => {
|
|
5
|
+
export const isAtomDefault = (key: string, store: Store): boolean => {
|
|
10
6
|
const core = target(store)
|
|
11
7
|
return core.atomsThatAreDefault.has(key)
|
|
12
8
|
}
|
|
13
9
|
|
|
14
|
-
export const markAtomAsDefault = (
|
|
15
|
-
key: string,
|
|
16
|
-
store: Store = IMPLICIT.STORE,
|
|
17
|
-
): void => {
|
|
10
|
+
export const markAtomAsDefault = (key: string, store: Store): void => {
|
|
18
11
|
const core = target(store)
|
|
19
12
|
core.atomsThatAreDefault = new Set(core.atomsThatAreDefault).add(key)
|
|
20
13
|
}
|
|
21
14
|
|
|
22
|
-
export const markAtomAsNotDefault = (
|
|
23
|
-
key: string,
|
|
24
|
-
store: Store = IMPLICIT.STORE,
|
|
25
|
-
): void => {
|
|
15
|
+
export const markAtomAsNotDefault = (key: string, store: Store): void => {
|
|
26
16
|
const core = target(store)
|
|
27
17
|
core.atomsThatAreDefault = new Set(target(store).atomsThatAreDefault)
|
|
28
18
|
core.atomsThatAreDefault.delete(key)
|
|
29
19
|
}
|
|
30
20
|
|
|
31
|
-
export const isSelectorDefault = (
|
|
32
|
-
key: string,
|
|
33
|
-
store: Store = IMPLICIT.STORE,
|
|
34
|
-
): boolean => {
|
|
21
|
+
export const isSelectorDefault = (key: string, store: Store): boolean => {
|
|
35
22
|
const rootKeys = traceAllSelectorAtoms(key, store)
|
|
36
23
|
return rootKeys.every((rootKey) => isAtomDefault(rootKey, store))
|
|
37
24
|
}
|
package/internal/src/caching.ts
CHANGED
|
@@ -1,55 +1,60 @@
|
|
|
1
1
|
import type { StateUpdate } from "atom.io"
|
|
2
2
|
import { Future } from "./future"
|
|
3
3
|
import type { Store } from "./store"
|
|
4
|
-
import { IMPLICIT } from "./store"
|
|
5
4
|
import type { Subject } from "./subject"
|
|
6
5
|
import { target } from "./transaction"
|
|
7
6
|
|
|
8
|
-
export
|
|
7
|
+
export function cacheValue<T>(
|
|
9
8
|
key: string,
|
|
10
|
-
value:
|
|
9
|
+
value: T,
|
|
11
10
|
subject: Subject<StateUpdate<unknown>>,
|
|
12
|
-
store: Store
|
|
13
|
-
):
|
|
11
|
+
store: Store,
|
|
12
|
+
): T
|
|
13
|
+
export function cacheValue<T extends Promise<any>>(
|
|
14
|
+
key: string,
|
|
15
|
+
value: T,
|
|
16
|
+
subject: Subject<StateUpdate<unknown>>,
|
|
17
|
+
store: Store,
|
|
18
|
+
): Future<T>
|
|
19
|
+
export function cacheValue<T>(
|
|
20
|
+
key: string,
|
|
21
|
+
value: T,
|
|
22
|
+
subject: Subject<StateUpdate<unknown>>,
|
|
23
|
+
store: Store,
|
|
24
|
+
): Future<T> | T {
|
|
14
25
|
const currentValue = target(store).valueMap.get(key)
|
|
15
26
|
if (currentValue instanceof Future) {
|
|
16
27
|
currentValue.cancel()
|
|
17
28
|
}
|
|
18
29
|
if (value instanceof Promise) {
|
|
19
|
-
const future = new Future(value)
|
|
30
|
+
const future = new Future<T>(value)
|
|
20
31
|
target(store).valueMap.set(key, future)
|
|
21
32
|
future
|
|
22
|
-
.then((
|
|
33
|
+
.then((resolved) => {
|
|
23
34
|
if (future.isCanceled) {
|
|
24
35
|
return
|
|
25
36
|
}
|
|
26
|
-
cacheValue(key,
|
|
27
|
-
subject.next({ newValue:
|
|
37
|
+
cacheValue(key, resolved, subject, store)
|
|
38
|
+
subject.next({ newValue: resolved, oldValue: future })
|
|
28
39
|
})
|
|
29
40
|
.catch((thrown) => {
|
|
30
41
|
if (thrown !== `canceled`) {
|
|
31
42
|
store.logger.error(`💥`, `state`, key, `rejected:`, thrown)
|
|
32
43
|
}
|
|
33
44
|
})
|
|
34
|
-
|
|
35
|
-
target(store).valueMap.set(key, value)
|
|
45
|
+
return future
|
|
36
46
|
}
|
|
47
|
+
target(store).valueMap.set(key, value)
|
|
48
|
+
return value
|
|
37
49
|
}
|
|
38
50
|
|
|
39
|
-
export const readCachedValue = <T>(
|
|
40
|
-
key
|
|
41
|
-
store: Store = IMPLICIT.STORE,
|
|
42
|
-
): T => target(store).valueMap.get(key)
|
|
51
|
+
export const readCachedValue = <T>(key: string, store: Store): T =>
|
|
52
|
+
target(store).valueMap.get(key)
|
|
43
53
|
|
|
44
|
-
export const isValueCached = (
|
|
45
|
-
key
|
|
46
|
-
store: Store = IMPLICIT.STORE,
|
|
47
|
-
): boolean => target(store).valueMap.has(key)
|
|
54
|
+
export const isValueCached = (key: string, store: Store): boolean =>
|
|
55
|
+
target(store).valueMap.has(key)
|
|
48
56
|
|
|
49
|
-
export const evictCachedValue = (
|
|
50
|
-
key: string,
|
|
51
|
-
store: Store = IMPLICIT.STORE,
|
|
52
|
-
): void => {
|
|
57
|
+
export const evictCachedValue = (key: string, store: Store): void => {
|
|
53
58
|
const core = target(store)
|
|
54
59
|
const currentValue = core.valueMap.get(key)
|
|
55
60
|
if (currentValue instanceof Future) {
|
|
@@ -9,13 +9,14 @@ import type { Json } from "atom.io/json"
|
|
|
9
9
|
import { stringifyJson } from "atom.io/json"
|
|
10
10
|
|
|
11
11
|
import { createAtom } from "../atom"
|
|
12
|
-
import {
|
|
12
|
+
import { deposit, withdraw } from "../store"
|
|
13
|
+
import type { Store } from "../store"
|
|
13
14
|
import { Subject } from "../subject"
|
|
14
15
|
import { target } from "../transaction"
|
|
15
16
|
|
|
16
17
|
export function createAtomFamily<T, K extends Json.Serializable>(
|
|
17
18
|
options: AtomFamilyOptions<T, K>,
|
|
18
|
-
store: Store
|
|
19
|
+
store: Store,
|
|
19
20
|
): AtomFamily<T, K> {
|
|
20
21
|
const subject = new Subject<AtomToken<T>>()
|
|
21
22
|
const atomFamily = Object.assign(
|
|
@@ -14,7 +14,7 @@ import { target } from "../transaction"
|
|
|
14
14
|
|
|
15
15
|
export function createReadonlySelectorFamily<T, K extends Json.Serializable>(
|
|
16
16
|
options: ReadonlySelectorFamilyOptions<T, K>,
|
|
17
|
-
store
|
|
17
|
+
store: Store,
|
|
18
18
|
): ReadonlySelectorFamily<T, K> {
|
|
19
19
|
const core = target(store)
|
|
20
20
|
const subject = new Subject<ReadonlySelectorToken<T>>()
|
|
@@ -11,22 +11,22 @@ import { stringifyJson } from "atom.io/json"
|
|
|
11
11
|
|
|
12
12
|
import { createSelector } from "../selector"
|
|
13
13
|
import type { Store } from "../store"
|
|
14
|
-
import {
|
|
14
|
+
import { deposit } from "../store"
|
|
15
15
|
import { Subject } from "../subject"
|
|
16
16
|
import { target } from "../transaction"
|
|
17
17
|
import { createReadonlySelectorFamily } from "./create-readonly-selector-family"
|
|
18
18
|
|
|
19
19
|
export function createSelectorFamily<T, K extends Json.Serializable>(
|
|
20
20
|
options: SelectorFamilyOptions<T, K>,
|
|
21
|
-
store
|
|
21
|
+
store: Store,
|
|
22
22
|
): SelectorFamily<T, K>
|
|
23
23
|
export function createSelectorFamily<T, K extends Json.Serializable>(
|
|
24
24
|
options: ReadonlySelectorFamilyOptions<T, K>,
|
|
25
|
-
store
|
|
25
|
+
store: Store,
|
|
26
26
|
): ReadonlySelectorFamily<T, K>
|
|
27
27
|
export function createSelectorFamily<T, K extends Json.Serializable>(
|
|
28
28
|
options: ReadonlySelectorFamilyOptions<T, K> | SelectorFamilyOptions<T, K>,
|
|
29
|
-
store: Store
|
|
29
|
+
store: Store,
|
|
30
30
|
): ReadonlySelectorFamily<T, K> | SelectorFamily<T, K> {
|
|
31
31
|
const isReadonly = !(`set` in options)
|
|
32
32
|
|
package/internal/src/index.ts
CHANGED
|
@@ -2,10 +2,12 @@ export * from "./atom"
|
|
|
2
2
|
export * from "./caching"
|
|
3
3
|
export * from "./families"
|
|
4
4
|
export * from "./future"
|
|
5
|
-
export * from "./get-state-internal"
|
|
6
5
|
export * from "./keys"
|
|
7
|
-
export * from "./
|
|
6
|
+
export * from "./lazy-map"
|
|
8
7
|
export * from "./mutable"
|
|
8
|
+
export * from "./not-found-error"
|
|
9
|
+
export * from "./operation"
|
|
10
|
+
export * from "./read-or-compute-value"
|
|
9
11
|
export * from "./selector"
|
|
10
12
|
export * from "./set-state"
|
|
11
13
|
export * from "./store"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export class LazyMap<K, V> extends Map<K, V> {
|
|
2
|
+
public deleted = new Set<K>()
|
|
3
|
+
|
|
4
|
+
public constructor(protected readonly source: Map<K, V>) {
|
|
5
|
+
super()
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
public get(key: K): V | undefined {
|
|
9
|
+
const has = super.has(key)
|
|
10
|
+
if (has) {
|
|
11
|
+
return super.get(key)
|
|
12
|
+
}
|
|
13
|
+
if (!this.deleted.has(key) && this.source.has(key)) {
|
|
14
|
+
const value = this.source.get(key)
|
|
15
|
+
super.set(key, value as V)
|
|
16
|
+
return value
|
|
17
|
+
}
|
|
18
|
+
return undefined
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public _has(key: K): boolean {
|
|
22
|
+
return super.has(key)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public has(key: K): boolean {
|
|
26
|
+
return !this.deleted.has(key) && (super.has(key) || this.source.has(key))
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public delete(key: K): boolean {
|
|
30
|
+
this.deleted.add(key)
|
|
31
|
+
return super.delete(key)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -3,7 +3,7 @@ import type { Json } from "atom.io/json"
|
|
|
3
3
|
import { selectJsonFamily } from "atom.io/json"
|
|
4
4
|
|
|
5
5
|
import type { Store } from ".."
|
|
6
|
-
import {
|
|
6
|
+
import { createAtomFamily } from ".."
|
|
7
7
|
import { FamilyTracker } from "./tracker-family"
|
|
8
8
|
import type { Transceiver } from "./transceiver"
|
|
9
9
|
|
|
@@ -13,7 +13,7 @@ export function createMutableAtomFamily<
|
|
|
13
13
|
Key extends string,
|
|
14
14
|
>(
|
|
15
15
|
options: MutableAtomFamilyOptions<Core, SerializableCore, Key>,
|
|
16
|
-
store: Store
|
|
16
|
+
store: Store,
|
|
17
17
|
): MutableAtomFamily<Core, SerializableCore, Key> {
|
|
18
18
|
const coreFamily = Object.assign(
|
|
19
19
|
createAtomFamily<Core, Key>(options, store),
|
|
@@ -5,7 +5,6 @@ import { selectJson } from "atom.io/json"
|
|
|
5
5
|
|
|
6
6
|
import { createAtom } from "../atom"
|
|
7
7
|
import type { Store } from "../store"
|
|
8
|
-
import { IMPLICIT } from "../store"
|
|
9
8
|
import { target } from "../transaction"
|
|
10
9
|
import { Tracker } from "./tracker"
|
|
11
10
|
import type { Transceiver } from "./transceiver"
|
|
@@ -15,7 +14,7 @@ export function createMutableAtom<
|
|
|
15
14
|
SerializableCore extends Json.Serializable,
|
|
16
15
|
>(
|
|
17
16
|
options: MutableAtomOptions<Core, SerializableCore>,
|
|
18
|
-
store: Store
|
|
17
|
+
store: Store,
|
|
19
18
|
): MutableAtomToken<Core, SerializableCore> {
|
|
20
19
|
store.logger.info(
|
|
21
20
|
`🔧`,
|