reactjrx 4.0.8 → 4.0.9
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/state/persistence/constants.d.ts +4 -0
- package/dist/lib/state/persistence/helpers.d.ts +7 -2
- package/dist/lib/state/persistence/types.d.ts +9 -2
- package/package.json +1 -1
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
1
2
|
import { Adapter } from './adapters/Adapter';
|
|
2
3
|
import { SignalPersistenceConfig } from './types';
|
|
3
4
|
export declare const persistValue: ({ adapter, config, }: {
|
|
4
5
|
adapter: Adapter;
|
|
5
6
|
config: SignalPersistenceConfig<any>;
|
|
6
|
-
}) =>
|
|
7
|
+
}) => Observable<unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Emits the value the signal was hydrated with, or `NOTHING_STORED` when
|
|
10
|
+
* nothing usable is stored.
|
|
11
|
+
*/
|
|
7
12
|
export declare function hydrateValueToSignal({ adapter, config, resetToDefault, }: {
|
|
8
13
|
adapter: Adapter;
|
|
9
14
|
config: SignalPersistenceConfig<any>;
|
|
@@ -12,4 +17,4 @@ export declare function hydrateValueToSignal({ adapter, config, resetToDefault,
|
|
|
12
17
|
* leaving its current value in place.
|
|
13
18
|
*/
|
|
14
19
|
resetToDefault?: boolean;
|
|
15
|
-
}):
|
|
20
|
+
}): Observable<unknown>;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Signal, SignalValue } from '../Signal';
|
|
2
2
|
import { IDENTIFIER_PERSISTENCE_KEY } from './constants';
|
|
3
3
|
export interface PersistenceEntry {
|
|
4
|
-
value
|
|
4
|
+
value?: unknown;
|
|
5
|
+
/**
|
|
6
|
+
* Set when the signal held `undefined`, which JSON drops from `value`. An
|
|
7
|
+
* entry with neither stores nothing, as entries written before this flag
|
|
8
|
+
* do.
|
|
9
|
+
*/
|
|
10
|
+
isUndefined?: true;
|
|
5
11
|
migrationVersion?: number;
|
|
6
12
|
[IDENTIFIER_PERSISTENCE_KEY]: typeof IDENTIFIER_PERSISTENCE_KEY;
|
|
7
13
|
}
|
|
@@ -9,7 +15,8 @@ export interface SignalPersistenceConfig<S extends Signal<any, string>> {
|
|
|
9
15
|
version: number;
|
|
10
16
|
signal: S;
|
|
11
17
|
/**
|
|
12
|
-
*
|
|
18
|
+
* Called with the stored value when the signal is hydrated from it. The
|
|
19
|
+
* value is `undefined` when the signal was saved holding `undefined`.
|
|
13
20
|
*/
|
|
14
21
|
hydrate?: (params: {
|
|
15
22
|
version: number;
|