Last active
August 4, 2016 08:17
-
-
Save frontdevops/868670e35cadad15dedb8fce3143d8ce to your computer and use it in GitHub Desktop.
Redux-elm declarations written on Facebook Flowtype (source file named index.js.flow)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
import type { Component as ReactComponent } from 'react'; | |
export type Action = Object; | |
export type StatelessReactComponent = (props : Object) => ReactElement; | |
export type Component = ReactComponent | StatelessReactComponent; | |
export type Dispatch = (action : Action) => void; | |
export type MatcherResult = { | |
wrap: string; | |
unwrap: string; | |
args: Object; | |
}; | |
export type Matcher = (pattern : string) => ((action : Action) => MatcherResult | boolean); | |
export interface Matchers { | |
static matcher : Matcher; | |
static parameterizedMatcher : Matcher; | |
}; | |
declare export class Updater<M> { | |
constructor(initialModel : M, saga? : () => Generator, matcher? : Matcher) : Updater<M>; | |
case(pattern : string, handler : (model : M, action : Action) => M, matcher? : Matcher) : Updater<M>; | |
toReducer() : (model : M, action : Action) => M | |
}; | |
declare export function forwardTo(dispatch : function, ...rest : Array<any>) : function; | |
declare export function wrapAction(action : Object, ...rest : Array<any>) : Object; | |
declare export function view(component : Component) : Component; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment