Where to write to localStorage in a Redux app?
I want to persist some parts of my state tree to the localStorage. What is the appropriate place to do so? Reducer or action? 9 Answers 9
I want to persist some parts of my state tree to the localStorage. What is the appropriate place to do so? Reducer or action? 9 Answers 9
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 months ago. The community reviewed whether to reopen this question 3 months ago and left it closed: Original close reason(s) … Read more
I’ve successfully implemented onRetainNonConfigurationInstance() for my main Activity to save and restore certain critical components across screen orientation changes. But it seems, my custom views are being re-created from scratch when the orientation changes. This makes sense, although in my case it’s inconvenient because the custom view in question is an X/Y plot and the … Read more
I’ve been reading a lot of stuff about functional programming lately, and I can understand most of it, but the one thing I just can’t wrap my head around is stateless coding. It seems to me that simplifying programming by removing mutable state is like “simplifying” a car by removing the dashboard: the finished product … Read more
I’m creating an app where the user can design his own form. E.g. specify name of the field and details of which other columns that should be included. The component is available as a JSFiddle here. My initial state looks like this: var DynamicForm = React.createClass({ getInitialState: function() { var items = {}; items[1] = … Read more
Is it at all possible to update object’s properties with setState? Something like: this.state = { jasper: { name: ‘jasper’, age: 28 }, } I have tried: this.setState({jasper.name: ‘someOtherName’}); and this: this.setState({jasper: {name: ‘someothername’}}) The first results in a syntax error and the second just does nothing. Any ideas? 23 Answers 23
I am creating an application which requires login. I created the main and the login activity. In the main activity onCreate method I added the following condition: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); … loadSettings(); if(strSessionString == null) { login(); } … } The onActivityResult method which is executed when the login form terminates … Read more