@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.
Files changed (2) hide show
  1. package/README.md +16 -22
  2. 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
  [![Stable Version](https://img.shields.io/npm/v/@o3r/store-sync?style=for-the-badge)](https://www.npmjs.com/package/@o3r/store-sync)
13
13
  [![Bundle Size](https://img.shields.io/bundlephobia/min/@o3r/store-sync?color=green&style=for-the-badge)](https://www.npmjs.com/package/@o3r/store-sync)
14
14
 
15
- This module is exposing an NgRx store synchronization solution (synchronous and asynchronous) via the class `StorageSync`.
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) that is also exposed and includes the following changes on top of the original version:
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
- - Export properly the `dateReviver` function
20
- - Add missing comments
21
- - Explicit dependency to `@ngrx/store` for the action names
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
- ### Configuration
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
- #### Smart sync
26
+ ## How to install
33
27
 
34
- The original ngrx-store-localstorage synchronize all of your states everytime a state is updated which can lead to a lot
35
- of accesses to the local and session storage and cause performance issue.
28
+ ```shell
29
+ ng add @o3r/store-sync
30
+ ```
36
31
 
37
- To avoid this pitfall, by default the @o3r/store-sync only synchronizes a state if its value changed and no longer matches
38
- the storage.
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
- ```typescript
42
- const storage = new StorageSync({keys: [...myStorekeys]}, {disableSmartSync: true});
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-next.2",
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-next.2",
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-next.2",
22
- "@o3r/logger": "^11.0.0-next.2",
23
- "@o3r/schematics": "^11.0.0-next.2",
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
  },