atom.io 0.9.5 → 0.9.7
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/internal/dist/index.d.mts +1 -1
- package/internal/dist/index.d.ts +1 -1
- package/internal/dist/index.js +10 -2
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/index.mjs +10 -2
- package/internal/dist/index.mjs.map +1 -1
- package/internal/src/caching.ts +3 -0
- package/internal/src/future.ts +1 -1
- package/internal/src/timeline/timeline-internal.ts +5 -0
- package/package.json +3 -3
|
@@ -342,7 +342,7 @@ type Fated<T, E extends Error = Error> = Loadable<E | T>;
|
|
|
342
342
|
* Can be constructed like a Promise, or from an existing Promise.
|
|
343
343
|
*/
|
|
344
344
|
declare class Future<T> extends Promise<T> {
|
|
345
|
-
|
|
345
|
+
isCanceled: boolean;
|
|
346
346
|
constructor(executor: Promise<T> | ((resolve: (value: T) => void, reject: (reason?: any) => void) => void));
|
|
347
347
|
cancel(): void;
|
|
348
348
|
}
|
package/internal/dist/index.d.ts
CHANGED
|
@@ -342,7 +342,7 @@ type Fated<T, E extends Error = Error> = Loadable<E | T>;
|
|
|
342
342
|
* Can be constructed like a Promise, or from an existing Promise.
|
|
343
343
|
*/
|
|
344
344
|
declare class Future<T> extends Promise<T> {
|
|
345
|
-
|
|
345
|
+
isCanceled: boolean;
|
|
346
346
|
constructor(executor: Promise<T> | ((resolve: (value: T) => void, reject: (reason?: any) => void) => void));
|
|
347
347
|
cancel(): void;
|
|
348
348
|
}
|
package/internal/dist/index.js
CHANGED
|
@@ -775,7 +775,7 @@ var undo__INTERNAL = (token, store = IMPLICIT.STORE) => {
|
|
|
775
775
|
|
|
776
776
|
// src/timeline/timeline-internal.ts
|
|
777
777
|
function timeline__INTERNAL(options, store = IMPLICIT.STORE, data = null) {
|
|
778
|
-
var _a, _b, _c;
|
|
778
|
+
var _a, _b, _c, _d;
|
|
779
779
|
const tl = __spreadProps(__spreadValues({
|
|
780
780
|
type: `timeline`,
|
|
781
781
|
key: options.key,
|
|
@@ -804,6 +804,11 @@ function timeline__INTERNAL(options, store = IMPLICIT.STORE, data = null) {
|
|
|
804
804
|
addAtomToTimeline(token2, tl, store);
|
|
805
805
|
}
|
|
806
806
|
});
|
|
807
|
+
for (const atom of core.atoms.values()) {
|
|
808
|
+
if (((_c = atom.family) == null ? void 0 : _c.key) === family.key) {
|
|
809
|
+
addAtomToTimeline(atom, tl, store);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
807
812
|
} else {
|
|
808
813
|
const token2 = tokenOrFamily;
|
|
809
814
|
if (`family` in token2 && token2.family) {
|
|
@@ -811,7 +816,7 @@ function timeline__INTERNAL(options, store = IMPLICIT.STORE, data = null) {
|
|
|
811
816
|
token2.family.key
|
|
812
817
|
);
|
|
813
818
|
if (familyTimelineKey) {
|
|
814
|
-
(
|
|
819
|
+
(_d = store.config.logger) == null ? void 0 : _d.error(
|
|
815
820
|
`\u274C Failed to add atom "${token2.key}" to timeline "${options.key}" because its family "${token2.family.key}" belongs to timeline "${familyTimelineKey}"`
|
|
816
821
|
);
|
|
817
822
|
continue;
|
|
@@ -910,6 +915,9 @@ var cacheValue = (key, value, subject, store = IMPLICIT.STORE) => {
|
|
|
910
915
|
const future = new Future(value);
|
|
911
916
|
target(store).valueMap.set(key, future);
|
|
912
917
|
future.then((value2) => {
|
|
918
|
+
if (future.isCanceled) {
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
913
921
|
cacheValue(key, value2, subject, store);
|
|
914
922
|
subject.next({ newValue: value2, oldValue: value2 });
|
|
915
923
|
}).catch((error) => {
|