placed the redux-utils goop in a different directory

This commit is contained in:
Ken
2019-01-31 13:34:19 -08:00
parent 6da255c206
commit 2ecb667b3a
4 changed files with 49 additions and 36 deletions

View File

@@ -0,0 +1,9 @@
import { Action } from 'redux';
type ActionWithPayload<T, P> = Action<T> & P;
export function action<T extends string>(type: T): Action<T>;
export function action<T extends string, P>(type: T, payload: P): ActionWithPayload<T, P>;
export function action<T extends string, P>(type: T, payload?: P) {
return { type, ...payload };
}