@s-libs/app-state
Advanced tools
Comparing version 12.0.0 to 13.0.0-next.0
@@ -25,2 +25,2 @@ import { Observable } from 'rxjs'; | ||
*/ | ||
export declare function spreadArrayStore$<T>(source: Store<Array<T> | null | undefined>): Observable<Array<Store<T>>>; | ||
export declare function spreadArrayStore$<T>(source: Store<T[] | null | undefined>): Observable<Array<Store<T>>>; |
import { Observable } from 'rxjs'; | ||
import { Store } from '../index'; | ||
export declare type UndoOrRedo = 'undo' | 'redo'; | ||
export declare type UndoOrRedo = 'redo' | 'undo'; | ||
export declare abstract class UndoManager<StateType, UndoStateType> { | ||
@@ -5,0 +5,0 @@ protected readonly store: Store<StateType>; |
{ | ||
"name": "@s-libs/app-state", | ||
"version": "12.0.0", | ||
"version": "13.0.0-next.0", | ||
"author": "Simonton Software", | ||
@@ -13,16 +13,29 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@s-libs/js-core": "^12.0.0", | ||
"@s-libs/micro-dash": "^12.0.0", | ||
"@s-libs/rxjs-core": "^12.0.0" | ||
"@s-libs/js-core": "^13.0.0-next.0", | ||
"@s-libs/micro-dash": "^13.0.0-next.0", | ||
"@s-libs/rxjs-core": "^13.0.0-next.0" | ||
}, | ||
"dependencies": { | ||
"tslib": "^2.1.0" | ||
"tslib": "^2.3.0" | ||
}, | ||
"main": "bundles/app-state.umd.js", | ||
"module": "fesm2015/app-state.js", | ||
"es2015": "fesm2015/app-state.js", | ||
"esm2015": "esm2015/app-state.js", | ||
"fesm2015": "fesm2015/app-state.js", | ||
"module": "fesm2015/app-state.mjs", | ||
"es2020": "fesm2020/app-state.mjs", | ||
"esm2020": "esm2020/app-state.mjs", | ||
"fesm2020": "fesm2020/app-state.mjs", | ||
"fesm2015": "fesm2015/app-state.mjs", | ||
"typings": "app-state.d.ts", | ||
"exports": { | ||
"./package.json": { | ||
"default": "./package.json" | ||
}, | ||
".": { | ||
"types": "./app-state.d.ts", | ||
"esm2020": "./esm2020/app-state.mjs", | ||
"es2020": "./fesm2020/app-state.mjs", | ||
"es2015": "./fesm2015/app-state.mjs", | ||
"node": "./fesm2015/app-state.mjs", | ||
"default": "./fesm2020/app-state.mjs" | ||
} | ||
}, | ||
"sideEffects": false | ||
} |
@@ -177,24 +177,1 @@ An observable state management library. Think of it like Redux, but without actions or reducers. That makes it a natural fit for anyone who wants the benefits of centralized state management, without adopting a function style of programming. | ||
Consult the documentation in the source of `UndoState` for more options and information. | ||
## Upgrading from the non-S-Libs version | ||
If you are upgrading from the loose version of [`ng-app-state`](https://github.com/simontonsoftware/ng-app-state), there are a number of changes to be aware of. App state no longer depends on `@ngrx/store`. Among other changes, it is now a standalone library, depending only on other packages in S-Libs. There are also some exciting performance improvements. In the end, you'll need to make these changes: | ||
- Remove `@ngrx/store` and `@ngrx/store-devtools` from your project, unless you are using them outside of `app-state`. | ||
- Remove `StoreModule.forRoot()`, `ngAppStateReducer`, and `StoreDevtoolsModule.instrument()` from `app.module.ts`. | ||
- To log state changes to the redux devtools extension, check out the new [`logToReduxDevtoolsExtension()`](file:///C:/Users/xemno/IdeaProjects/s-libs/docs/rxjs-core/index.html#logtoreduxdevtoolsextension) in `@s-libs/rxjs-core`. For example if you make your own subclass of `RootStore`, you could put this in its constructor: | ||
```ts | ||
logToReduxDevtoolsExtension(this.$, { | ||
name: "MyStore", | ||
autoPause: true, | ||
}); | ||
``` | ||
- Replace references to `StoreObject` with `Store`. | ||
- Replace references to `AppStore` with `RootStore`. | ||
- The constructor for `RootStore` takes only 1 argument: its starting state. When transitioning from `AppStore` to `RootStore`, remove the other 2 arguments. | ||
- Remove calls to `withCaching()`. The redesigned library comes with intelligent caching built in automatically. | ||
- Batches are no longer tied to a specific slice of the store, but always operate on the entire `RootStore`. Therefore, `.batch()` was moved to `RootStore` and its callback no longer receives a `Store` object. Instead, operate on the store using any existing store object and it will automatically be included in the batch. `Store.getRootStore()` was added to get a reference to start the batch from if needed. | ||
- `.inBatch()` has been removed. | ||
- The `batch` parameter was removed from `UndoManager.applyUndoState()`. It still operates in a batch, but now you can use `this.store` in its place with no need for the additional argument. |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
190279
1781
1
177
1
+ Added@s-libs/js-core@13.1.0(transitive)
+ Added@s-libs/micro-dash@13.1.0(transitive)
+ Added@s-libs/rxjs-core@13.1.0(transitive)
+ Addedrxjs@7.8.1(transitive)
- Removed@s-libs/js-core@12.0.0(transitive)
- Removed@s-libs/micro-dash@12.0.0(transitive)
- Removed@s-libs/rxjs-core@12.0.0(transitive)
- Removedrxjs@6.6.7(transitive)
- Removedtslib@1.14.1(transitive)
Updatedtslib@^2.3.0