@o3r/store-sync 11.0.0-next.2 → 11.0.0-prerelease.2
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/README.md +16 -22
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -12,32 +12,26 @@ This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/ot
|
|
|
12
12
|
[](https://www.npmjs.com/package/@o3r/store-sync)
|
|
13
13
|
[](https://www.npmjs.com/package/@o3r/store-sync)
|
|
14
14
|
|
|
15
|
-
This module
|
|
15
|
+
This module exposes an NgRx store synchronization solution (synchronous and asynchronous) via the class `StorageSync`.
|
|
16
16
|
|
|
17
|
-
To facilitate the synchronization, the `StorageSync` class is based on a fork of [ngrx-store-localstorage](https://github.com/btroncone/ngrx-store-localstorage)
|
|
17
|
+
To facilitate the synchronization, the `StorageSync` class is based on a fork of [ngrx-store-localstorage](https://github.com/btroncone/ngrx-store-localstorage), an exposed package used to sync an NgRx store and the local or session storage.
|
|
18
|
+
Compared to the original version of the fork, the **@o3r/store-sync** module includes changes that improve overall synchronization performance.
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
- Change interface names to prefix with "sync"
|
|
23
|
-
- Add logger support
|
|
24
|
-
- Fix lint according to ESLint rules
|
|
25
|
-
- Split code in several files
|
|
26
|
-
- Migrate tests to Jest
|
|
27
|
-
- Removal of deprecated `deepmerge` dependency.
|
|
28
|
-
- Support of a `smartSync` setup to improve performances
|
|
20
|
+
The features to highlight are:
|
|
21
|
+
* The addition of `smartSync`: by default, **@o3r/store-sync** synchronizes a state only if its value changed and no longer matches that of the storage. This feature improves performance, but it can be disabled if wanted.
|
|
22
|
+
* The possibility of **asynchronous synchronization**: in our asynchronous storage interface, we have overridden the return type of the `getItem` function to handle promises (the return type is `Promise<string | null>`).
|
|
29
23
|
|
|
30
|
-
|
|
24
|
+
You can read about the changes in the module's [documentation](https://github.com/AmadeusITGroup/otter/blob/main/docs/store-sync/STORE_SYNC.md).
|
|
31
25
|
|
|
32
|
-
|
|
26
|
+
## How to install
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
```shell
|
|
29
|
+
ng add @o3r/store-sync
|
|
30
|
+
```
|
|
36
31
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
This behaviour can be disabled as follows:
|
|
32
|
+
> [!WARNING]
|
|
33
|
+
> This module requires [@o3r/core](https://www.npmjs.com/package/@o3r/core) to be installed.
|
|
40
34
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
## More details
|
|
36
|
+
|
|
37
|
+
Find more information in the [documentation](https://github.com/AmadeusITGroup/otter/blob/main/docs/store-sync/STORE_SYNC.md).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/store-sync",
|
|
3
|
-
"version": "11.0.0-
|
|
3
|
+
"version": "11.0.0-prerelease.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"otter-module"
|
|
14
14
|
],
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"@ama-sdk/core": "^11.0.0-
|
|
16
|
+
"@ama-sdk/core": "^11.0.0-prerelease.2",
|
|
17
17
|
"@angular-devkit/core": "~17.3.0",
|
|
18
18
|
"@angular-devkit/schematics": "~17.3.0",
|
|
19
19
|
"@ngrx/entity": "~17.2.0",
|
|
20
20
|
"@ngrx/store": "~17.2.0",
|
|
21
|
-
"@o3r/core": "^11.0.0-
|
|
22
|
-
"@o3r/logger": "^11.0.0-
|
|
23
|
-
"@o3r/schematics": "^11.0.0-
|
|
21
|
+
"@o3r/core": "^11.0.0-prerelease.2",
|
|
22
|
+
"@o3r/logger": "^11.0.0-prerelease.2",
|
|
23
|
+
"@o3r/schematics": "^11.0.0-prerelease.2",
|
|
24
24
|
"fast-deep-equal": "^3.1.3",
|
|
25
25
|
"rxjs": "^7.8.1"
|
|
26
26
|
},
|