declare export function connect()

in fusion-plugin-rpc-redux-react/flow-typed/npm/react-redux_v7.x.x.js [166:223]


  declare export function connect<-P, -OP, -SP: {||}, -DP, S, D>(
    mapStateToProps: null | void,
    mapDispatchToProps: MapDispatchToPropsFn<D, OP, DP>,
    mergeProps: MergeProps<P, OP, {||}, DP>,
    options?: ?Options<S, OP, {||}, P>,
  ): Connector<P, OP, P>;

  // In this case DP is an object of action creators not yet bound to dispatch,
  // this difference is not important in the vanila redux,
  // but in case of usage with redux-thunk, the return type may differ.
  declare export function connect<-P, -OP, -SP: {||}, -DP, S, D>(
    mapStateToProps: null | void,
    mapDispatchToProps: DP,
    mergeProps: MergeProps<P, OP, {||}, $ObjMap<DP, Bind<D>>>,
    options?: ?Options<S, OP, {||}, P>,
  ): Connector<P, OP, P>;

  // In this case DP is an object of functions which has been bound to dispatch
  // by the given mapDispatchToProps function.
  declare export function connect<-P, -OP, -SP, -DP, S, D>(
    mapStateToProps: MapStateToProps<S, OP, SP>,
    mapDispatchToProps: MapDispatchToPropsFn<D, OP, DP>,
    mergeProps: MergeProps<P, OP, SP, DP>,
    options?: ?Options<S, OP, SP, P>,
  ): Connector<P, OP, P>;

  // In this case DP is an object of action creators not yet bound to dispatch,
  // this difference is not important in the vanila redux,
  // but in case of usage with redux-thunk, the return type may differ.
  declare export function connect<-P, -OP, -SP, -DP, S, D>(
    mapStateToProps: MapStateToProps<S, OP, SP>,
    mapDispatchToProps: DP,
    mergeProps: MergeProps<P, OP, SP, $ObjMap<DP, Bind<D>>>,
    options?: ?Options<S, OP, SP, P>,
  ): Connector<P, OP, P>;

  // ------------------------------------------------------------
  // Typings for Hooks
  // ------------------------------------------------------------

  declare export function useDispatch<D>(): D;

  declare export function useSelector<S, SS>(
    selector: (state: S) => SS,
    equalityFn?: (a: SS, b: SS) => boolean,
  ): SS;

  declare export function useStore<Store>(): Store;

  // ------------------------------------------------------------
  // Typings for Provider
  // ------------------------------------------------------------

  declare export class Provider<Store> extends React$Component<{
    store: Store,
    children?: React$Node,
    ...
  }> {}