File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ where
146146 K : ' static + Eq + Hash + Clone ,
147147{
148148 let client = use_query_client ( ) ;
149- use_sync_memo ( query_keys. clone ( ) , | | {
149+ use_sync_memo ( query_keys, move |query_keys | {
150150 let mut query = query ( ) ;
151151 query. registry_entry . query_keys = query_keys. to_vec ( ) ;
152152
@@ -205,7 +205,7 @@ where
205205/// - T needs to be Clone (cannot be avoided)
206206fn use_sync_memo < T : ' static + Clone , D : PartialEq + ' static > (
207207 deps : D ,
208- init : impl FnOnce ( ) -> T ,
208+ init : impl FnOnce ( & D ) -> T ,
209209) -> T {
210210 struct Memoized < T , D > {
211211 value : T ,
@@ -220,7 +220,7 @@ fn use_sync_memo<T: 'static + Clone, D: PartialEq + 'static>(
220220 != Some ( & deps) ;
221221
222222 let new_value = if deps_have_changed {
223- Some ( init ( ) )
223+ Some ( init ( & deps ) )
224224 } else {
225225 None
226226 } ;
You can’t perform that action at this time.
0 commit comments