@@ -5,14 +5,14 @@ import { MessageBase, Nullable, UpdateMap } from "./ElmUtilities";
55import { useCallback , useEffect , useState } from "react" ;
66
77export type SubscriptionResult < TMessage > = [ Cmd < TMessage > , ( ( ) => void ) ?] ;
8- type Subscription < TModel , TMessage > = ( model : TModel ) => SubscriptionResult < TMessage > ;
8+ type Subscription < TProps , TModel , TMessage > = ( model : TModel , props : TProps ) => SubscriptionResult < TMessage > ;
99
1010interface UseElmishOptions < TProps , TModel , TMessage extends MessageBase > {
1111 name : string ,
1212 props : TProps ,
1313 init : InitFunction < TProps , TModel , TMessage > ,
1414 update : UpdateFunction < TProps , TModel , TMessage > | UpdateMap < TProps , TModel , TMessage > ,
15- subscription ?: Subscription < TModel , TMessage > ,
15+ subscription ?: Subscription < TProps , TModel , TMessage > ,
1616}
1717
1818/**
@@ -108,7 +108,7 @@ export function useElmish<TProps, TModel, TMessage extends MessageBase> ({ name,
108108
109109 useEffect ( ( ) => {
110110 if ( subscription ) {
111- const [ subCmd , destructor ] = subscription ( initializedModel as TModel ) ;
111+ const [ subCmd , destructor ] = subscription ( initializedModel as TModel , props ) ;
112112
113113 execCmd ( subCmd ) ;
114114
0 commit comments