Merge pull request #18130 from GiedriusGrabauskas/patch-8

Flux: added StoresList type
This commit is contained in:
Wesley Wigham
2017-07-17 18:00:54 -07:00
committed by GitHub
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -37,8 +37,10 @@ export interface RealOptions {
export type ComponentConstructor<TProps> = React.ComponentClass<TProps> | React.StatelessComponent<TProps>;
export type StoresList = Array<FluxStore<any>>;
export interface ComponentStatic<TProps, TState, TContext> {
getStores(maybeProps?: TProps, maybeContext?: TContext): Array<FluxStore<any>>;
getStores(maybeProps?: TProps, maybeContext?: TContext): StoresList;
calculateState(prevState: TState, maybeProps?: TProps, maybeContext?: TContext): TState;
}
+1 -1
View File
@@ -38,7 +38,7 @@ interface State {
}
class CounterContainer extends React.Component<Props, State> {
static getStores() {
static getStores(): Container.StoresList {
return [Store];
}