Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reason for explicitly dropping the notifyManager? #87

Closed
peterferguson opened this issue Aug 13, 2024 · 0 comments · Fixed by #91
Closed

Reason for explicitly dropping the notifyManager? #87

peterferguson opened this issue Aug 13, 2024 · 0 comments · Fixed by #91

Comments

@peterferguson
Copy link
Contributor

peterferguson commented Aug 13, 2024

notifyManager in RQ is used to batch calls together and optimise re-renders is there a reason this is dropped in this library?

const unsubscribe = observer.subscribe((state) => {

const unsubscribe = observer.subscribe((state) => {

Versus the tanstack repos own useMutation

      (onStoreChange) =>
        observer.subscribe(notifyManager.batchCalls(onStoreChange)),

& useBaseQuery observer subbing code

      (onStoreChange) => {
        const unsubscribe = isRestoring
          ? () => undefined
          : observer.subscribe(notifyManager.batchCalls(onStoreChange))

        // Update result to make sure we did not miss any query updates
        // between creating the observer and subscribing to it.
        observer.updateResult()

        return unsubscribe
      },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant