question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC - Remove all current binding functions except for Hooks

See original GitHub issue

I’m thinking about a bold breaking change.

After this awesome PR by @d3x7r0, you can use Redux Zero with a really small API, based on Hooks:

const Counter = () => {
  const store = useStore();
  const count = useSelector(({ count }) => count);
  const increment = useAction(({ count }) => ({ count: count + 1 }));

  return (
    <>
      <p>Count: {count}</p>
      <button onClick={increment}>Increment</button>
    </>
  )
}

With that, it seems that the other approaches (connect and Connect) simply don’t make sense anymore. I’m highly considering rebranding Redux Zero to be all about this three hooks. No more, no less.

What do you think?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
matheusmlcommented, Apr 12, 2020

Hey @makinde, thanks for the feedback.

No, classes don’t support hooks. So the reason why I want to go all-in into hooks only API is:

  1. That’s where React itself is going
  2. I don’t think that having two ways of doing the same thing is beneficial. Because you’ll have more API to learn, more code to maintain and bigger bundle size

I’m already building some experiments to drop support with Connect/connect and go all-in into hooks. And maybe even rebranding the project.

0reactions
makindecommented, Apr 12, 2020

Thanks for responding. You should definitely feel empowered to direct things as you see best.

I’ll just quickly highlight some of what you gain with the current “redux-like” branding and messaging. Because I know that this library is supposed to be like redux, I can depend on their docs. For instance, I’m trying to learn middleware in redux-zero right now. The docs are…brief, to say the least. But because it is so similar to the redux concept, I can rely on the tons of documents and blog posts about the topic.

Just something to keep in mind as you consider diverging from redux in the future. Thanks for all the hard work on the tool!

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC 3435 - Media Gateway Control Protocol (MGCP) Version ...
1 Overview of Commands This section describes the commands of the MGCP. · 2 EndpointConfiguration The EndpointConfiguration command can be used to specify...
Read more >
[RFC|Merged] General Hook Architecture of phpBB3.1
Functions to be called by a hook are identified by naming convention. The hook “foo” automatically invokes all MOD methods named “<MODNAME>_foo” ...
Read more >
iCalendar Transport-Independent Interoperability Protocol (iTIP)
Please refer to the current edition of the "Internet Official Protocol Standards" (STD ... Binding documents such as [iMIP] focus on the transport...
Read more >
componentWillMount is deprecated and will be removed in the ...
You should move all the code from the componentWillMount to the constructor or componentDidMount. componentWillMount() is invoked just ...
Read more >
What you need to know about the React useEvent Hook RFC
log('Event handler'); } // ... } React destroys the current version of the handleEvent function and creates a new version each time AComponent ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found