@@ -16,7 +16,7 @@ type RPCReducersType = {
1616 success ?: Reducer < * , * > ,
1717 failure ?: Reducer < * , * > ,
1818} ;
19- export const withRPCReactor = (
19+ export function withRPCReactor < Props : { } > (
2020 rpcId : string ,
2121 reducers : RPCReducersType ,
2222 {
@@ -26,37 +26,34 @@ export const withRPCReactor = (
2626 } : {
2727 propName ?: string ,
2828 transformParams ?: ( params : any ) => any ,
29- mapStateToParams ?: ( state : any , args ? : any , ownProps ? : any ) => any ,
29+ mapStateToParams ?: ( state : any , args ?: any , ownProps : Props ) => any ,
3030 } = { }
31- ) => {
31+ ) {
3232 return withRPCRedux ( rpcId , {
3333 actions : createRPCReactors ( rpcId , reducers ) ,
3434 propName,
3535 rpcId,
3636 transformParams,
3737 mapStateToParams,
3838 } ) ;
39- } ;
39+ }
4040
41- export function withRPCRedux (
41+ export function withRPCRedux < Props : { } > (
4242 rpcId : string ,
4343 {
44- propName,
44+ propName = rpcId ,
4545 actions,
4646 transformParams,
4747 mapStateToParams,
4848 } : {
4949 propName ?: string ,
5050 actions ?: any ,
5151 transformParams ?: ( params : any ) => any ,
52- mapStateToParams ?: ( state : any , args ? : any , ownProps ? : any ) => any ,
52+ mapStateToParams ?: ( state : any , args ?: any , ownProps : Props ) => any ,
5353 } = { }
5454) : ( React . ComponentType < * > ) => React . ComponentType < * > {
55- if ( ! propName ) {
56- propName = rpcId ;
57- }
58- return ( Component : React . ComponentType < * > ) => {
59- class withRPCRedux extends React . Component < * , * > {
55+ return ( Component : React . ComponentType < Props > ) => {
56+ class withRPCRedux extends React . Component < Props , * > {
6057 render ( ) {
6158 const { rpc, store} = this . context ;
6259 if ( mapStateToParams ) {
0 commit comments