fix(core): update
This commit is contained in:
parent
4d0567a95d
commit
23061c86eb
1946
package-lock.json
generated
1946
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -9,20 +9,22 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/)",
|
||||||
"build": "(tsbuild)",
|
"build": "(tsbuild && tsbundle npm)",
|
||||||
"format": "(gitzone format)"
|
"format": "(gitzone format)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.24",
|
"@gitzone/tsbuild": "^2.1.24",
|
||||||
|
"@gitzone/tsbundle": "^1.0.69",
|
||||||
"@gitzone/tstest": "^1.0.28",
|
"@gitzone/tstest": "^1.0.28",
|
||||||
"@pushrocks/tapbundle": "^3.2.1",
|
"@pushrocks/tapbundle": "^3.2.1",
|
||||||
"@types/node": "^14.0.1",
|
"@types/node": "^14.0.5",
|
||||||
"tslint": "^6.1.2",
|
"tslint": "^6.1.2",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/lik": "^4.0.0",
|
"@pushrocks/lik": "^4.0.12",
|
||||||
"@pushrocks/smartpromise": "^3.0.6",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
|
"@pushrocks/smartrx": "^2.0.15",
|
||||||
"rxjs": "^6.5.5"
|
"rxjs": "^6.5.5"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -20,7 +20,6 @@ a package that handles state in a good way
|
|||||||
|
|
||||||
Use TypeScript for best in class intellisense.
|
Use TypeScript for best in class intellisense.
|
||||||
|
|
||||||
|
|
||||||
## Contribution
|
## Contribution
|
||||||
|
|
||||||
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
|
@ -44,9 +44,4 @@ export class Smartstate<StatePartNameType> {
|
|||||||
this.statePartMap[statePartName as any] = newState;
|
this.statePartMap[statePartName as any] = newState;
|
||||||
return newState;
|
return newState;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* dispatches an action on the main level
|
|
||||||
*/
|
|
||||||
public dispatch() {}
|
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
import * as plugins from './smartstate.plugins';
|
import * as plugins from './smartstate.plugins';
|
||||||
|
|
||||||
import { Observable, Subject } from 'rxjs';
|
|
||||||
import { startWith, takeUntil, map } from 'rxjs/operators';
|
|
||||||
|
|
||||||
import { StateAction, IActionDef } from './smartstate.classes.stateaction';
|
import { StateAction, IActionDef } from './smartstate.classes.stateaction';
|
||||||
|
|
||||||
export class StatePart<TStatePartName, TStatePayload> {
|
export class StatePart<TStatePartName, TStatePayload> {
|
||||||
public name: TStatePartName;
|
public name: TStatePartName;
|
||||||
public state = new Subject<TStatePayload>();
|
public state = new plugins.smartrx.rxjs.Subject<TStatePayload>();
|
||||||
public stateStore: TStatePayload;
|
public stateStore: TStatePayload;
|
||||||
|
|
||||||
constructor(nameArg: TStatePartName) {
|
constructor(nameArg: TStatePartName) {
|
||||||
@ -40,14 +36,16 @@ export class StatePart<TStatePartName, TStatePayload> {
|
|||||||
/**
|
/**
|
||||||
* selects a state or a substate
|
* selects a state or a substate
|
||||||
*/
|
*/
|
||||||
public select<T = TStatePayload>(selectorFn?: (state: TStatePayload) => T): Observable<T> {
|
public select<T = TStatePayload>(
|
||||||
|
selectorFn?: (state: TStatePayload) => T
|
||||||
|
): plugins.smartrx.rxjs.Observable<T> {
|
||||||
if (!selectorFn) {
|
if (!selectorFn) {
|
||||||
selectorFn = (state: TStatePayload) => <T>(<any>state);
|
selectorFn = (state: TStatePayload) => <T>(<any>state);
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapped = this.state.pipe(
|
const mapped = this.state.pipe(
|
||||||
startWith(this.getState()),
|
plugins.smartrx.rxjs.ops.startWith(this.getState()),
|
||||||
map(stateArg => {
|
plugins.smartrx.rxjs.ops.map(stateArg => {
|
||||||
try {
|
try {
|
||||||
return selectorFn(stateArg);
|
return selectorFn(stateArg);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
import { Observable } from 'rxjs';
|
|
||||||
|
|
||||||
const rxjsPart = {
|
|
||||||
Observable
|
|
||||||
};
|
|
||||||
|
|
||||||
export { rxjsPart };
|
|
||||||
|
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
|
import * as smartrx from '@pushrocks/smartrx';
|
||||||
|
|
||||||
export { smartpromise };
|
export { smartpromise, smartrx };
|
||||||
|
Loading…
Reference in New Issue
Block a user