typedux
Version:
Slightly adjusted Redux (awesome by default) for TS
49 lines (48 loc) • 1.14 kB
TypeScript
/// <reference types="bluebird" />
import type { ObservableStore } from "../store/ObservableStore";
import { ActionStatus } from "./ActionTypes";
import { Bluebird as Promise } from '../util';
/**
* Wraps an action providing tracking events and data
*/
export declare class ActionTracker<T> {
id: string;
leaf: string;
name: string;
action: (dispatch: any, getState: any) => T;
store: ObservableStore<any>;
/**
* Resolve the underlying promise
*/
private resolve;
/**
* Reject the underlying promise
*/
private reject;
/**
* Action Status
*
* @type {ActionStatus}
*/
status: ActionStatus;
/**
* Action promise
*/
private _promise;
/**
* Get the underlying promise
*
* @returns {Promise<T>}
*/
get promise(): Promise<T>;
/**
* Create new action tracker
*
* @param leaf
* @param name
* @param action
* @param id
* @param store
*/
constructor(id: string, leaf: string, name: string, action: (dispatch: any, getState: any) => T, store: ObservableStore<any>);
}