@reactables/core 1.2.1 → 1.3.0-alpha.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.
|
@@ -11,7 +11,7 @@ export interface EffectsAndSources {
|
|
|
11
11
|
}
|
|
12
12
|
export interface RxConfig<T, S extends Cases<T>> extends SliceConfig<T, S>, EffectsAndSources {
|
|
13
13
|
debug?: boolean;
|
|
14
|
-
/**@deprecated Use storeValue
|
|
14
|
+
/**@deprecated Use storeValue decorator instead to add store value behaviour to reactable */
|
|
15
15
|
storeValue?: boolean;
|
|
16
16
|
}
|
|
17
17
|
export declare const RxBuilder: <T, S extends Cases<T>>({ effects, sources, debug, storeValue, ...sliceConfig }: RxConfig<T, S>) => Reactable<T, { [K in keyof S]: (payload?: unknown) => void; }>;
|
|
@@ -2,4 +2,6 @@ import { Reactable } from '../Models';
|
|
|
2
2
|
export interface DestroyAction {
|
|
3
3
|
destroy: () => void;
|
|
4
4
|
}
|
|
5
|
-
export declare const storeValue: <T, S>(reactable: Reactable<T, S
|
|
5
|
+
export declare const storeValue: <T, S>(reactable: Reactable<T, S & {
|
|
6
|
+
destroy?: () => void;
|
|
7
|
+
}>) => Reactable<T, S & DestroyAction>;
|
package/dist/index.js
CHANGED
|
@@ -295,7 +295,12 @@ var storeValue = function (reactable) {
|
|
|
295
295
|
var replaySubject$ = new rxjs.ReplaySubject(1);
|
|
296
296
|
var state$ = reactable[0], actions = reactable[1], actions$ = reactable[2];
|
|
297
297
|
var subscription = state$.subscribe(function (state) { return replaySubject$.next(state); });
|
|
298
|
-
var destroy = function () {
|
|
298
|
+
var destroy = function () {
|
|
299
|
+
var _a;
|
|
300
|
+
// If destroy action already exists (i.e from a web worker), invoke it
|
|
301
|
+
(_a = actions.destroy) === null || _a === void 0 ? void 0 : _a.call(actions);
|
|
302
|
+
subscription.unsubscribe();
|
|
303
|
+
};
|
|
299
304
|
return [replaySubject$, __assign(__assign({}, actions), { destroy: destroy }), actions$];
|
|
300
305
|
};
|
|
301
306
|
|
package/package.json
CHANGED