@rimbu/actor
Advanced tools
Comparing version 0.6.8 to 0.7.0
@@ -54,2 +54,3 @@ "use strict"; | ||
(0, tslib_1.__extends)(Impl, _super); | ||
//implements Obs<T, D> { | ||
function Impl(pureState, options, derivedState, fullState) { | ||
@@ -177,3 +178,5 @@ if (derivedState === void 0) { derivedState = (_a = options === null || options === void 0 ? void 0 : options.derive) === null || _a === void 0 ? void 0 : _a.call(options, pureState, pureState); } | ||
Impl.prototype.select = function (pathInState, options) { | ||
return this.map(function (newParentState) { return deep_1.Path.getValue(newParentState, pathInState); }, function (newChildState) { | ||
return this.map(function (newParentState) { | ||
return deep_1.Path.getValue(newParentState, pathInState); | ||
}, function (newChildState) { | ||
var e_2, _a; | ||
@@ -180,0 +183,0 @@ var pathObj = {}; |
@@ -32,2 +32,3 @@ import { Literal, patch, Path } from '@rimbu/deep'; | ||
class Impl extends NotifierBase { | ||
//implements Obs<T, D> { | ||
constructor(pureState, options, derivedState, fullState) { | ||
@@ -34,0 +35,0 @@ var _a; |
{ | ||
"name": "@rimbu/actor", | ||
"version": "0.6.8", | ||
"version": "0.7.0", | ||
"description": "State management tools to create stateful logic that can be easily integrated in any framework", | ||
@@ -58,3 +58,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@rimbu/deep": "^0.7.6", | ||
"@rimbu/deep": "^0.8.0", | ||
"tslib": "^2.3.1" | ||
@@ -68,3 +68,3 @@ }, | ||
}, | ||
"gitHead": "20739fd0c0d5c565eeecd3e266dd51f893e8d67c" | ||
"gitHead": "c321aa32b1c5fd8ca8b7fb1c26bd4f7bbf3ef70d" | ||
} |
@@ -47,15 +47,2 @@ <p align="center"> | ||
## Recommended `tsconfig.json` settings | ||
Rimbu uses advanced and recursive typing, potentially making the TS compiler quite slow. It is recommended to set the following values in the `tsconfig.json` file of your project: | ||
```json | ||
{ | ||
"compilerOptions": { | ||
"skipLibCheck": true, | ||
"noStrictGenericChecks": true | ||
} | ||
} | ||
``` | ||
## Usage | ||
@@ -62,0 +49,0 @@ |
@@ -39,3 +39,4 @@ import { Immutable, Literal, patch, Patch, Path } from '@rimbu/deep'; | ||
class Impl<T, D> extends NotifierBase<Immutable<T & D>> implements Obs<T, D> { | ||
class Impl<T, D> extends NotifierBase<Immutable<T & D>> { | ||
//implements Obs<T, D> { | ||
constructor( | ||
@@ -141,3 +142,3 @@ public pureState: T, | ||
const onFirstSubscription = (): Obs.UnsubscribeFn => { | ||
const unsubscribe1 = this.subscribe((newState) => | ||
const unsubscribe1 = this.subscribe((newState: Immutable<T & D>) => | ||
result.setState(mapTo(newState)) | ||
@@ -179,3 +180,3 @@ ); | ||
const onFirstSubscription = (): Obs.UnsubscribeFn => { | ||
const unsubscribe1 = this.subscribe((newState) => { | ||
const unsubscribe1 = this.subscribe((newState: Immutable<T & D>) => { | ||
result.setState(mapTo(newState)); | ||
@@ -206,3 +207,3 @@ }); | ||
return result; | ||
return result as any; | ||
} | ||
@@ -221,4 +222,5 @@ | ||
): Obs<Path.Result<T, P>, DR> { | ||
return this.map( | ||
(newParentState) => Path.getValue(newParentState as T, pathInState), | ||
return this.map<Path.Result<T, P>, DR>( | ||
(newParentState: Immutable<T & D>) => | ||
Path.getValue(newParentState as T, pathInState), | ||
(newChildState: Immutable<Path.Result<T, P>>): Patch<T> => { | ||
@@ -228,3 +230,3 @@ const pathObj = {}; | ||
if (parts.length <= 0) return Literal.of(newChildState); | ||
if (parts.length <= 0) return Literal.of(newChildState) as any; | ||
@@ -259,3 +261,3 @@ const lastPart = parts.pop()!; | ||
): Obs.Readonly<Path.Result<T & D, P> & DR> { | ||
return this.mapReadonly( | ||
return this.mapReadonly<Path.Result<T & D, P>, DR>( | ||
(newParentState: Immutable<T & D>) => | ||
@@ -280,3 +282,3 @@ Path.getValue(newParentState as T & D, pathInState), | ||
const onFirstSubscription = (): Obs.UnsubscribeFn => { | ||
const unsubscribe1 = this.subscribe((newState) => { | ||
const unsubscribe1 = this.subscribe((newState: Immutable<T & D>) => { | ||
result.setState(mapTo(newState, other.state)); | ||
@@ -321,3 +323,3 @@ }); | ||
const onFirstSubscription = (): Obs.UnsubscribeFn => { | ||
const unsubscribe1 = this.subscribe((newState) => { | ||
const unsubscribe1 = this.subscribe((newState: Immutable<T & D>) => { | ||
result.setState(mapTo(newState, other.state)); | ||
@@ -358,3 +360,3 @@ }); | ||
return result; | ||
return result as any; | ||
} | ||
@@ -798,4 +800,4 @@ } | ||
): Obs<T, D> { | ||
return new Impl<T, D>(initState, options); | ||
return new Impl<T, D>(initState, options) as any; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2253
115786
91
+ Added@rimbu/base@0.7.2(transitive)
+ Added@rimbu/common@0.8.2(transitive)
+ Added@rimbu/deep@0.8.2(transitive)
- Removed@rimbu/base@0.6.7(transitive)
- Removed@rimbu/common@0.7.5(transitive)
- Removed@rimbu/deep@0.7.6(transitive)
Updated@rimbu/deep@^0.8.0