{"action":"created","issue":{"url":"https://api.github.com/repos/didierfranc/react-waterfall/issues/91","repository_url":"https://api.github.com/repos/didierfranc/react-waterfall","labels_url":"https://api.github.com/repos/didierfranc/react-waterfall/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/didierfranc/react-waterfall/issues/91/comments","events_url":"https://api.github.com/repos/didierfranc/react-waterfall/issues/91/events","html_url":"https://github.com/didierfranc/react-waterfall/issues/91","id":374136248,"node_id":"MDU6SXNzdWUzNzQxMzYyNDg=","number":91,"title":"The future of react-waterfall","user":{"login":"didierfranc","id":14132464,"node_id":"MDQ6VXNlcjE0MTMyNDY0","avatar_url":"https://avatars1.githubusercontent.com/u/14132464?v=4","gravatar_id":"","url":"https://api.github.com/users/didierfranc","html_url":"https://github.com/didierfranc","followers_url":"https://api.github.com/users/didierfranc/followers","following_url":"https://api.github.com/users/didierfranc/following{/other_user}","gists_url":"https://api.github.com/users/didierfranc/gists{/gist_id}","starred_url":"https://api.github.com/users/didierfranc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/didierfranc/subscriptions","organizations_url":"https://api.github.com/users/didierfranc/orgs","repos_url":"https://api.github.com/users/didierfranc/repos","events_url":"https://api.github.com/users/didierfranc/events{/privacy}","received_events_url":"https://api.github.com/users/didierfranc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"didierfranc","id":14132464,"node_id":"MDQ6VXNlcjE0MTMyNDY0","avatar_url":"https://avatars1.githubusercontent.com/u/14132464?v=4","gravatar_id":"","url":"https://api.github.com/users/didierfranc","html_url":"https://github.com/didierfranc","followers_url":"https://api.github.com/users/didierfranc/followers","following_url":"https://api.github.com/users/didierfranc/following{/other_user}","gists_url":"https://api.github.com/users/didierfranc/gists{/gist_id}","starred_url":"https://api.github.com/users/didierfranc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/didierfranc/subscriptions","organizations_url":"https://api.github.com/users/didierfranc/orgs","repos_url":"https://api.github.com/users/didierfranc/repos","events_url":"https://api.github.com/users/didierfranc/events{/privacy}","received_events_url":"https://api.github.com/users/didierfranc/received_events","type":"User","site_admin":false},"assignees":[{"login":"didierfranc","id":14132464,"node_id":"MDQ6VXNlcjE0MTMyNDY0","avatar_url":"https://avatars1.githubusercontent.com/u/14132464?v=4","gravatar_id":"","url":"https://api.github.com/users/didierfranc","html_url":"https://github.com/didierfranc","followers_url":"https://api.github.com/users/didierfranc/followers","following_url":"https://api.github.com/users/didierfranc/following{/other_user}","gists_url":"https://api.github.com/users/didierfranc/gists{/gist_id}","starred_url":"https://api.github.com/users/didierfranc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/didierfranc/subscriptions","organizations_url":"https://api.github.com/users/didierfranc/orgs","repos_url":"https://api.github.com/users/didierfranc/repos","events_url":"https://api.github.com/users/didierfranc/events{/privacy}","received_events_url":"https://api.github.com/users/didierfranc/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-10-25T21:16:34Z","updated_at":"2018-11-08T11:58:55Z","closed_at":null,"author_association":"OWNER","body":"We're using `react-waterfall` in my entourage since February without any big issue, the simplicity of the implementation and the priceless fixes from the community has made it deadly stable.\r\n\r\nI watched every issues, comments, pull request here and I think we can explore a lot of path for the next version so let's do it !\r\n\r\nWhat if we'll make it even simpler ? recent React proposals like **Suspense** and **Hooks** make me think that creating a library to manage every aspect of a centralized state is useless. What if next version of react-waterfall or the next big thing in the world of ***React store management*** was just a set of tiny method to use the power of React with more convenience ?\r\n\r\n#### 👉 This is what I'm doing with React 16.7\r\n```js\r\nimport React, { createContext, useContext, useState } from \"react\";\r\nimport { storify }  from \"react-waterfall\";\r\n\r\nconst Context = createContext();\r\nconst { Provider } = Context;\r\n\r\nconst store = storify({\r\n  state: [\r\n    { text: \"Code another javascript library\", completed: false },\r\n    { text: \"Make this javascript library obsolete\", completed: false }\r\n  ],\r\n  addTodo: (todos, todo) => [...todos, { text: todo }]\r\n});\r\n\r\nconst TodoList = () => {\r\n  let input;\r\n  const state = useContext(Context);\r\n  const addTodo = () => store.addTodo(input.value);\r\n\r\n  return (\r\n    <>\r\n      <input ref={el => (input = el)} />\r\n      <button onClick={addTodo}>+</button>\r\n      {state.map(todo => (\r\n        <div>{todo.text}</div>\r\n      ))}\r\n    </>\r\n  );\r\n};\r\n\r\nconst App = () => {\r\n  const [state, setState] = useState(store.state);\r\n  store.setGlobalSetState(setState);\r\n\r\n  return (\r\n    <Provider value={state}>\r\n      <TodoList />\r\n    </Provider>\r\n  );\r\n};\r\n\r\nexport default App;\r\n```"},"comment":{"url":"https://api.github.com/repos/didierfranc/react-waterfall/issues/comments/436970698","html_url":"https://github.com/didierfranc/react-waterfall/issues/91#issuecomment-436970698","issue_url":"https://api.github.com/repos/didierfranc/react-waterfall/issues/91","id":436970698,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjk3MDY5OA==","user":{"login":"marswong","id":10388933,"node_id":"MDQ6VXNlcjEwMzg4OTMz","avatar_url":"https://avatars0.githubusercontent.com/u/10388933?v=4","gravatar_id":"","url":"https://api.github.com/users/marswong","html_url":"https://github.com/marswong","followers_url":"https://api.github.com/users/marswong/followers","following_url":"https://api.github.com/users/marswong/following{/other_user}","gists_url":"https://api.github.com/users/marswong/gists{/gist_id}","starred_url":"https://api.github.com/users/marswong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marswong/subscriptions","organizations_url":"https://api.github.com/users/marswong/orgs","repos_url":"https://api.github.com/users/marswong/repos","events_url":"https://api.github.com/users/marswong/events{/privacy}","received_events_url":"https://api.github.com/users/marswong/received_events","type":"User","site_admin":false},"created_at":"2018-11-08T11:58:55Z","updated_at":"2018-11-08T11:58:55Z","author_association":"NONE","body":"absolutely i had checked out the examples and it's not a good practice to seperate state and actions."}}
{"actor":{"display_login":"marswong"}}