File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -100,15 +100,12 @@ export function useContext<Value, Selected>(
100100 [ selector ] ,
101101 ) ;
102102 const subscribe = useCallback ( (
103- ref : MutableRefObject < { value : Value ; listeners : Set < ( ) => void > } > ,
104- handleCallback : ( snapshot : Selected ) => void ,
103+ ref : MutableRefObject < { listeners : Set < ( ) => void > } > ,
104+ callback : ( ) => void ,
105105 ) => {
106- const listener = ( ) => {
107- handleCallback ( getSnapshot ( ref ) ) ;
108- } ;
109106 const { listeners } = ref . current ;
110- listeners . add ( listener ) ;
111- return ( ) => listeners . delete ( listener ) ;
112- } , [ getSnapshot ] ) ;
107+ listeners . add ( callback ) ;
108+ return ( ) => listeners . delete ( callback ) ;
109+ } , [ ] ) ;
113110 return useMutableSource ( source , getSnapshot , subscribe ) ;
114111}
You can’t perform that action at this time.
0 commit comments