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

How do you subscribe to entire context to replicate React.useContext? #63

Closed
laurencefass opened this issue Jan 18, 2022 · 0 comments
Closed

Comments

@laurencefass
Copy link

laurencefass commented Jan 18, 2022

Your example code shows how to subscribe to context variables
e.g.

const Counter2 = () => {
  const count2 = useContextSelector(context, v => v[0].count2);
  const setState = useContextSelector(context, v => v[1]);

How do I subscribe to the entire context using useContextSelector if i initialise my context with your CreateContext method?

React's useContext doesnt work if i use your createContext method to initialise context and I cant find documentation/code to subscribe to everything on the context and not just individual properties or state slices.

Thanks

@laurencefass laurencefass changed the title How do you subscribe to entire context to replicate original useContext? How do you subscribe to entire context to replicate React.useContext? Jan 18, 2022
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

No branches or pull requests

1 participant