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

upgrade to Redux Hooks #229

Open
yumingsam opened this issue Apr 24, 2023 · 2 comments
Open

upgrade to Redux Hooks #229

yumingsam opened this issue Apr 24, 2023 · 2 comments

Comments

@yumingsam
Copy link

With the new Redux Hooks API (https://react-redux.js.org/api/hooks), code uses redux would be simpler. It resolves the pains of using redux by removing needs of mapStateToProps etc.

Does this sounds a good idea? How could replugable to integrate it? Is there a plan?

@itsh01
Copy link
Collaborator

itsh01 commented Apr 24, 2023

Sounds like a good idea, but needs to be thought through (It wasn't raised before, so no plan yet).
We will need to align it to core mechanics of Repluggable.

I'd imagine something like

useShellProps(shell => ({
  value: shell.getAPI(SomeAPI).getValue()
}), [boundShell])

useObservableProps(shell => ({
  value: shell.getAPI(SomeAPI).observables.value
}), [boundShell])

What do you think?
(Contributions are welcome BTW 😄 )

@yumingsam
Copy link
Author

Thanks for your reply. I'm glad to know that would make replugable greater. I'd look forward to the support soon.
And will try to learn and think about the implementation.

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

2 participants