redux-framework

Redux: Opinions/examples of how to do backend persistence?

你说的曾经没有我的故事 提交于 2019-12-02 14:17:29
I am wondering how folks using Redux are approaching their backend persistence. Particularly, are you storing the "actions" in a database or are you only storing the last known state of the application? If you are storing the actions, are you simply requesting them from the server, then replaying all of them when a given page loads? Couldn't this lead to some performance issues with a large scale app where there are lots of actions? If you are storing just the "current state", how are you actually persisting this state at any given time as actions happen on a client? Does anyone have some code

How to sync Redux state and url query params

人盡茶涼 提交于 2019-11-30 10:53:42
问题 I have a web page with a search panel. Search panel has several input fields: id, size, ... What I want is when user set search values (for example: id=123 and size=45) and press a search button: searchState in Redux reducer should be updated with new search values (id=123 and size=45) URL should be changed to "http://mydomain/home?id=123&size=45" And on the other hand if the user changes URL to http://mydomain/home?id=111&size=22 then: searchState in reducer should be changed with new search

Subscribe to single property change in store in Redux

空扰寡人 提交于 2019-11-28 03:23:14
In Redux I can easily subscribe to store changes with store.subscribe(() => my handler goes here) But what if my store is full of different objects and in a particular place in my app I want to subscribe to changes made only in a specific object in the store? There is no way to subscribe to part of the store when using subscribe directly, but as the creator of Redux says himself - don't use subscribe directly! For the data flow of a Redux app to really work, you will want one component that wraps your entire app. This component will subscribe to your store. The rest of your components will be

Subscribe to single property change in store in Redux

孤街醉人 提交于 2019-11-27 04:12:35
问题 In Redux I can easily subscribe to store changes with store.subscribe(() => my handler goes here) But what if my store is full of different objects and in a particular place in my app I want to subscribe to changes made only in a specific object in the store? 回答1: There is no way to subscribe to part of the store when using subscribe directly, but as the creator of Redux says himself - don't use subscribe directly! For the data flow of a Redux app to really work, you will want one component