News for hackers. Stuff that matters.
Re:Redux – Not Dead Yet by crooked-v on Wednesday April 25, 2018 @01:14AM (#16918780)
The new context API effectively makes variables available globally, but you're still using a separate (explicitly declared) Consumer for each, so you don't have any of the basic issues that go with using a single set of globals.

For a very simple example:

    import { UserIdConsumer } from '@/contexts'

    const ThisComponent = () => (
      <div>
        User ID: <UserIdConsumer>{value => value}</UserIdConsumer>
      </div>
    )

    export default ThisComponent
Re:Redux – Not Dead Yet by hestefisk on Wednesday April 25, 2018 @04:19AM (#16919523)
Not sure I follow. Where does value come from?
Re:Redux – Not Dead Yet by tym0 on Wednesday April 25, 2018 @08:53AM (#16921042)
UserIdConsumer will call the children prop as function, UserIdConsumer could look like this:

    const UserIdConsumer props => <Fragment>props.children(theValueYouWantAvailable)</Fragment>