import * as React from "react"; import { Consumer } from "./../StoreProvider"; import { KeyMap } from "../types/ValueMap"; export default (fnName: string, clearKeys: string | string[]) => (Component: any) => (props: any) => { let clearObj: KeyMap = {}; if (typeof clearKeys === "string") clearObj[clearKeys] = undefined; else clearKeys.forEach(key => clearObj[key] = undefined) const clearFn = (context: any) => () => context.call(clearObj); return ( { (context: any) => } ); };