Содержание
- 2. Pavel Uvarov, Software Engineer at Epam Ryazan pavel_uvarov@epam.com spiderpoul poul_uvarov
- 3. Redux is a predictable state container
- 5. What I like about Redux? Predictable state management Global state Immutability A lot of middleware Easy
- 6. What we don’t like about Redux "Configuring a Redux store is too complicated" "I have to
- 7. Post message { type: “SHOW_SUPPORT_PAGE”, payload: { … } } Iframe React App
- 8. This tool will change the way you work with Redux 2-3x less code Strictly typed out
- 9. Special thanks to Yakov Zhmurov
- 10. React Redux Typescript + NASA API (nasa-app-react.netlify.app)
- 12. Too much boilerplate…
- 14. Less pain with React Redux Hooks
- 15. Even more with Typescript…
- 18. redux-act / redux-actions
- 19. Solutions to reduce boilerplate Search Page store (Typescript)
- 20. Redux Toolkit (@reduxjs/toolkit ) createSlice - a function that accepts an initial state, an object full
- 21. @reduxjs/toolkit - createSlice
- 22. Solutions to reduce boilerplate Search Page store (Typescript)
- 23. @reduxjs/toolkit – createSlice + createAsyncThunk dispatch(fetchSearchData(‘sun’))
- 24. Redux Toolkit Type safety
- 25. Solutions to reduce boilerplate Search Page store (Typescript)
- 26. Elm is a functional language that compiles to JavaScript. It has a strong emphasis on simplicity
- 27. State management with Elm
- 28. ELM: update : Msg -> Model -> Model JS: const update = action => State =>
- 29. Wouldn’t that be great…. const initialState = { name: ‘’, password: ‘’ } const setName =
- 30. Wouldn’t that be even greater…. Reducer Action Creators Types inference
- 31. Redux-blaze { type: “MY_FILTER_SET_CATEGORY” category: ‘my category’ }
- 32. redux-blaze buildReducer reducer – ready to use autogenerated reducer actionCreators – ready to use strictly typed
- 33. Easy to create High-order Reducers
- 34. createReduxFetcher
- 35. react-redux-blaze - createReduxFetcher All data keeps in redux global store Strictly typed Autogenerated reducer Handles loading
- 36. Another example “Earth page”
- 38. Redux-blaze
- 39. Solutions to reduce boilerplate Search Page store (Typescript)
- 40. After refactoring with redux-blaze
- 41. createSlice vs redux-blaze Pros: Customization Cons: Overcomplicated typing for TS Poor type inference Complicated configs Read
- 42. Redux-blaze Easy to understand and use Easy to use with Typescript Intellisense works even with plain
- 44. Is Redux alive?
- 46. Should we use Redux in 2020 for React Apps? I’d use Redux (with redux-blaze) for: complex
- 47. redux-blaze https://github.com/spiderpoul/redux-blaze https://github.com/spiderpoul/react-redux-blaze Nasa App https://nasa-app-react.netlify.app/ https://github.com/spiderpoul/nasa-app-react/tree/redux-blaze https://github.com/spiderpoul/nasa-app-react/tree/redux https://github.com/zeit/swr https://github.com/tannerlinsley/react-query
- 49. Скачать презентацию