News for hackers. Stuff that matters.

ikido

While I don't think that posting solutions or using them is the right thing to do I'm grateful to the author for mentioning the course — it's fantastic!
Re:Bots won't replace apps. Better apps will replace apps on Thursday April 21, 2016 @06:11AM (#11540783)
Very valid points addressed in this essay, I wonder if OS and messengers vendors will ever take that into account
Re:Mobx: Simple, scalable state management on Saturday February 27, 2016 @07:37AM (#11186931)
can you elaborate more why this approach is convoluted?
Re:Mobx: Simple, scalable state management on Saturday February 27, 2016 @07:35AM (#11186928)
Thanks, I'm actually working on it
Re:Mobx: Simple, scalable state management on Saturday February 27, 2016 @07:32AM (#11186921)
The concept of tracking data is actually quite simple — when you define some object property as observable it is replaced with a getter & setter that invoke a callback when you get/set that property. Then you can bind a function that will be called when data is changed (via setter).

You can also wrap some code into special autorun function, that will track what observable data was accessed, and when that data changes, that code will be called again.

But wait, there's more =) It works with arrays, objects and other types, check out the docs!

Re:Mobx: Simple, scalable state management on Saturday February 27, 2016 @04:56AM (#11186656)
That's a good point, but in Redux you subscribe to all changes in single state tree where all data lives. That means that every update of data (which has no upper limit) will cause your UI to re-render. Sure, you can implement shouldComponentUpdate, but still it will be called on every state update, plus you do can do exactly the same with mobx. The difference is that with mobx you subscribe to changes of certain data, and it happens automatically.
Re:Mobx: Simple, scalable state management on Saturday February 27, 2016 @12:21AM (#11186186)
No difference in how you handle routing and history in a regular React app, those things are not related. Mobx (and mobx-react) just re-renders your component when data changes. You can check out performance tests here: https://www.mendix.com/tech-blog/making-react-reactive-pursu...
Re:Mobx: Simple, scalable state management on Friday February 26, 2016 @11:16PM (#11186040)
I know that a lot of people like to use different kinds of flux libraries for their React apps, with Redux having a lot of traction, but you should definitely look at Mobx.

We've introduced it to one of our project 4 months ago and our state management became as simple and easy as it should be with React. No boilerplate subscriptions, no helpers that modify normalized data, no endless re-renders on every state change and very easy to understand concept for new developers.

We literally stopped worrying about the state though it took some time to rewrite the app.

Re:Show HN: A new kind of standing desk for $25 USD on Wednesday January 13, 2016 @09:34PM (#10899289)
Doesn't look very ergonomic — it's kind of hard to keep your hands in the air for a long time