ngrx-store-manager
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "ngrx-store-manager", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Moose-EL" |
@@ -6,2 +6,3 @@ # ngrx-store-manager | ||
* All actions results will be saved in the store automatically on success. | ||
* Allows saving store states into localStorage. | ||
@@ -49,2 +50,9 @@ ## Installation | ||
## LocalStorage Implementation | ||
`forRoot` method can take `options` as second argument, the current acceptable options is `useLocalStorage` which can be set to `true` which will make the module always save store states into localStorage. Since this is obviously not recommended in production environment, it is best to use `!environment.production` from your Angular environment file. | ||
```Typescript | ||
StorageManagerModule.forRoot(AppConfig, { useLocalStorage: !environment.production }) | ||
``` | ||
## Facade | ||
@@ -71,14 +79,12 @@ | ||
- `this.store.select('test', false)` will create an observable for the store named `test` which you can use with the `async` pipe. | ||
#### dispatch(storeName: string, action: string, payload?: any) | ||
- use this method to dispatch any event you need, payload is optional. | ||
- will return an observable of that store, it will populate only when the action is done (as in an http request), then you can subscribe to that observable to work with the results. | ||
#### getData(storeName: string, action?: string) | ||
- use it to dispatch an event without payload to the store. | ||
- `this.store.getData('test')` will dispatch a `GET` event which is the default event for that function. | ||
- an overload of the dispatch method with `GET` as default action and no payload. | ||
- `this.store.getData('test', 'GET_OTHER')` will dispatch a `GET_OTHER` event. | ||
- will return an observable of that store, it will populate only when the action is done (as in an http request), then you can subscribe to that observable to work with the results. | ||
#### setData(storeName: string, payload: any, action?: string) | ||
- use it to dispatch an event with a payload to the store. | ||
- `this.store.setData('test', payload)` will dispatch a `SET` event which is the default event for that function. | ||
- an overload of the dispatch method with `SET` as default action and payload is required. | ||
- `this.store.getData('test', payload, 'SET_OTHER')` will dispatch a `SET_OTHER` event. | ||
- will return an observable of that store, it will populate only when the action is done (as in an http request), then you can subscribe to that observable to work with the results. | ||
## Demo | ||
@@ -85,0 +91,0 @@ Please refer to the demo folder or follow this link https://stackblitz.com/edit/ngrx-store-manager-demo |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
198057
91