mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
placed the redux-utils goop in a different directory
This commit is contained in:
@@ -1,12 +1,4 @@
|
||||
import { Action } from 'redux';
|
||||
|
||||
type ActionWithPayload<T, P> = Action<T> & P;
|
||||
|
||||
function action<T extends string>(type: T): Action<T>;
|
||||
function action<T extends string, P>(type: T, payload: P): ActionWithPayload<T, P>;
|
||||
function action<T extends string, P>(type: T, payload?: P) {
|
||||
return { type, ...payload };
|
||||
}
|
||||
import { action } from '../redux-utils/action';
|
||||
|
||||
export const actions = {
|
||||
add: (label: string) => action('add', { label }),
|
||||
|
||||
Reference in New Issue
Block a user