Skip to content

Commit

Permalink
fix: make meta optional (default to undefined) (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
wub authored and JaKXz committed Jan 17, 2018
1 parent b83c9ae commit 93016e9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface FluxStandardAction<Payload, Meta> {
export interface FluxStandardAction<Payload, Meta = undefined> {
/**
* The `type` of an action identifies to the consumer the nature of the action that has occurred.
* Two actions with the same `type` MUST be strictly equivalent (using `===`)
Expand Down Expand Up @@ -26,26 +26,26 @@ export interface FluxStandardAction<Payload, Meta> {
meta: Meta;
}

export interface ErrorFluxStandardAction<CustomError extends Error, Meta> extends FluxStandardAction<CustomError, Meta> {
export interface ErrorFluxStandardAction<CustomError extends Error, Meta = undefined> extends FluxStandardAction<CustomError, Meta> {
error: true;
}

/**
* Alias for FluxStandardAction.
*/
export type FSA<Payload, Meta> = FluxStandardAction<Payload, Meta>;
export type FSA<Payload, Meta = undefined> = FluxStandardAction<Payload, Meta>;

/**
* Alias for ErrorFluxStandardAction.
*/
export type ErrorFSA<CustomError extends Error, Meta> = ErrorFluxStandardAction<CustomError, Meta>;
export type ErrorFSA<CustomError extends Error, Meta = undefined> = ErrorFluxStandardAction<CustomError, Meta>;

/**
* Returns `true` if `action` is FSA compliant.
*/
export function isFSA<Payload, Meta>(action: any): action is FluxStandardAction<Payload, Meta>;
export function isFSA<Payload, Meta = undefined>(action: any): action is FluxStandardAction<Payload, Meta>;

/**
* Returns `true` if `action` is FSA compliant error.
*/
export function isError<CustomError extends Error, Meta>(action: any): action is ErrorFluxStandardAction<CustomError, Meta>;
export function isError<CustomError extends Error, Meta = undefined>(action: any): action is ErrorFluxStandardAction<CustomError, Meta>;

0 comments on commit 93016e9

Please sign in to comment.