Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
declare module "react-copy-write" {
interface ConsumerProps<TState> {
select?: any;
children: (store: TState) => any;
}
interface ISelector<TState, TRet> {
select: (store: TState) => TRet;
}
class Consumer<T> extends Component<ConsumerProps<T>> {}
interface IState<TState> {
Consumer: new () => Consumer<TState>;
createSelector<TRet>(
selector: (state: TState) => TRet
): ISelector<TState, TRet>;
createConsumer<TState, T1>(
selector1: ISelector<TState, T1>
): new () => Consumer<T1>;
createConsumer<TState, T1, T2>(
selector1: ISelector<TState, T1>,
selector2: ISelector<TState, T2>
): new () => Consumer<T1 & T2>;
}
export function createStore<TState>(state: TState): IState<TState>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.