wip
This commit is contained in:
parent
0949200bac
commit
76a75c9120
@ -9,8 +9,15 @@ export type Dictionary<T> = { [key: string]: T };
|
|||||||
|
|
||||||
export type Mutation<S=any> = (payload: any, action: Action) => (state: S) => S ;
|
export type Mutation<S=any> = (payload: any, action: Action) => (state: S) => S ;
|
||||||
|
|
||||||
|
type ActionPayloadGenerator = (...args:any[]) => any;
|
||||||
|
|
||||||
export type ActionCreator = (...args: any[] ) => Action;
|
export type ActionCreator = (...args: any[] ) => Action;
|
||||||
|
|
||||||
export type UpduxConfig = Partial<{
|
export type UpduxConfig = Partial<{
|
||||||
subduxes: {}
|
subduxes: {},
|
||||||
|
actions: {
|
||||||
|
[ type: string ]: ActionPayloadGenerator
|
||||||
|
},
|
||||||
|
mutations: any,
|
||||||
|
effects: any,
|
||||||
}>;
|
}>;
|
||||||
|
@ -6,12 +6,15 @@ import buildMutations from './buildMutations';
|
|||||||
import buildCreateStore from './buildCreateStore';
|
import buildCreateStore from './buildCreateStore';
|
||||||
import buildMiddleware from './buildMiddleware';
|
import buildMiddleware from './buildMiddleware';
|
||||||
import buildUpreducer from './buildUpreducer';
|
import buildUpreducer from './buildUpreducer';
|
||||||
import { UpduxConfig, Dictionary } from './types';
|
import { UpduxConfig, Dictionary, Action, ActionCreator } from './types';
|
||||||
|
|
||||||
|
|
||||||
export class Updux {
|
export class Updux {
|
||||||
|
|
||||||
subduxes: Dictionary<Updux>;
|
subduxes: Dictionary<Updux>;
|
||||||
|
|
||||||
|
actions: Dictionary<ActionCreator>
|
||||||
|
|
||||||
constructor(config: UpduxConfig) {
|
constructor(config: UpduxConfig) {
|
||||||
|
|
||||||
this.subduxes = fp.mapValues(
|
this.subduxes = fp.mapValues(
|
||||||
|
Loading…
Reference in New Issue
Block a user