elsassph / haxe-redux

Haxe Redux externs and support classes for a smarter API
8 stars 2 forks source link

Added ReactRedux extern with connect and connectAdvanced #15

Closed kLabz closed 6 years ago

kLabz commented 6 years ago

Added ReactRedux.connect(...) and ReactRedux.connectAdvanced(...) externs with needed typedefs.

ReactRedux.connect(...) (doc)

public static function connect<TStateProps, TDispatchProps, TOwnProps, TProps>(
    ?mapStateToProps: Function,
    ?mapDispatchToProps: Dynamic,
    ?mergeProps: TStateProps -> TDispatchProps -> TOwnProps -> TProps,
    ?options: Partial<ConnectOptions>
): CreateElementType -> CreateElementType;

ReactRedux.connectAdvanced(...) (doc)

public static function connectAdvanced<TFactoryOptions, TState, TOwnProps, TProps, TOptions:ConnectAdvancedOptions>(
    selectorFactory: Dispatch -> TFactoryOptions -> (TState -> TOwnProps -> TProps),
    ?connectOptions: TOptions
):CreateElementType -> CreateElementType;