redux-actions-helper
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "redux-actions-helper", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -37,4 +37,5 @@ "main": "dist/index.js", | ||
"jest": "18.0.0", | ||
"redux": "*", | ||
"typescript": "2.3.4" | ||
} | ||
} |
@@ -1,6 +0,4 @@ | ||
export interface IBaseAction { | ||
type: string | ||
} | ||
import { Reducer, Action } from 'redux' | ||
export interface IAction<Payload> extends IBaseAction { | ||
export interface IAction<Payload> extends Action { | ||
payload?: Payload | ||
@@ -10,6 +8,8 @@ error?: boolean | ||
export interface IActionMeta<Payload, Meta> extends IAction<Payload> { | ||
meta: Meta | ||
export interface IActionMeta<Payload, Meta = any> extends IAction<Payload> { | ||
meta?: Meta | ||
} | ||
export type IAnyAction = IActionMeta<any> | ||
export interface IActionFunction<R>{ | ||
@@ -21,10 +21,10 @@ (...args: any[]): R | ||
export interface IActionFunctionMulti<R, T, M>{ | ||
(...args: any[]): R | ||
success: (...args: any[]) => T | ||
fail: (...args: any[]) => M | ||
toString: () => string | ||
(...args: any[]): R | ||
success: (...args: any[]) => T | ||
fail: (...args: any[]) => M | ||
toString: () => string | ||
} | ||
export function createActionPrefix( | ||
prefix?: string | ||
prefix?: string | ||
) : (name: string) => string | ||
@@ -44,3 +44,3 @@ | ||
IActionMeta<FailPayload, FailPayload> | ||
> | ||
> | ||
@@ -55,23 +55,22 @@ export function createAction<Payload, Meta, SuccessPayload, FailPayload>( | ||
IActionMeta<FailPayload, FailPayload> | ||
> | ||
> | ||
export type Reducer<State, Payload> = (state: State, action: IAction<Payload>) => State | ||
export interface IReducerNextThrow<State, Payload> { | ||
next?(state: State, action: IAction<Payload>): State | ||
throw?(state: State, action: IAction<Payload>): State | ||
export interface IReducerNextThrow<State, A extends Action = IAnyAction> { | ||
next?(state: State, action: A): State | ||
throw?(state: State, action: A): State | ||
} | ||
export interface IReducerMap<State, Payload> { | ||
[actionType: string]: Reducer<State, Payload> | IReducerNextThrow<State, Payload> | ||
export interface IReducerMap<State, A extends Action = IAnyAction> { | ||
[actionType: string]: Reducer<State, A> | IReducerNextThrow<State, A> | ||
} | ||
export function handleActions<State, Payload={}>( | ||
reducerMap: IReducerMap<State, Payload>, | ||
export function handleActions<State, Payload=any>( | ||
reducerMap: IReducerMap<State, IActionMeta<Payload>>, | ||
initialState: State, | ||
): Reducer<State, Payload> | ||
): Reducer<State, IActionMeta<Payload>> | ||
export function linstenActions<State, Payload={}>( | ||
reducerMapListener: () => IReducerMap<State, Payload>, | ||
export function linstenActions<State, Payload=any>( | ||
reducerMapListener: () => IReducerMap<State, IActionMeta<Payload>>, | ||
initialState: State, | ||
): Reducer<State, Payload> | ||
): Reducer<State, IActionMeta<Payload>> |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
24649
7
522
1