fix(core): update
This commit is contained in:
@ -9,7 +9,10 @@ export interface IActionDef<TStateType, TActionPayloadType> {
|
||||
* an actionmodifier for the state
|
||||
*/
|
||||
export class StateAction<TStateType, TActionPayloadType> {
|
||||
constructor(public statePartRef: StatePart<any, any>, public actionDef: IActionDef<TStateType, TActionPayloadType>) {}
|
||||
constructor(
|
||||
public statePartRef: StatePart<any, any>,
|
||||
public actionDef: IActionDef<TStateType, TActionPayloadType>
|
||||
) {}
|
||||
|
||||
public trigger(payload: TActionPayloadType) {
|
||||
this.statePartRef.dispatchAction(this, payload);
|
||||
|
@ -47,7 +47,7 @@ export class StatePart<TStatePartName, TStatePayload> {
|
||||
|
||||
const mapped = this.state.pipe(
|
||||
startWith(this.getState()),
|
||||
map((stateArg) => {
|
||||
map(stateArg => {
|
||||
try {
|
||||
return selectorFn(stateArg);
|
||||
} catch (e) {
|
||||
@ -80,7 +80,9 @@ export class StatePart<TStatePartName, TStatePayload> {
|
||||
* waits until a certain part of the state becomes available
|
||||
* @param selectorFn
|
||||
*/
|
||||
public async waitUntilPresent<T = TStatePayload>(selectorFn?: (state: TStatePayload) => T): Promise<T> {
|
||||
public async waitUntilPresent<T = TStatePayload>(
|
||||
selectorFn?: (state: TStatePayload) => T
|
||||
): Promise<T> {
|
||||
const done = plugins.smartpromise.defer<T>();
|
||||
const selectedObservable = this.select(selectorFn);
|
||||
const subscription = selectedObservable.subscribe(async value => {
|
||||
|
@ -8,6 +8,4 @@ export { rxjsPart };
|
||||
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
|
||||
export {
|
||||
smartpromise
|
||||
};
|
||||
export { smartpromise };
|
||||
|
Reference in New Issue
Block a user