Twitter | Search | |
Michel Weststrate
Software Engineer at . OSS maintainer, speaker, trainer. Author of MobX, mobx-state-tree, serializr, immer. Ex .πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§βœπŸ‡³πŸ‡±/πŸ‡¬πŸ‡§
11,465
Tweets
1,414
Following
15,036
Followers
Tweets
Michel Weststrate retweeted
Erik Rasmussen πŸ‘¨πŸ»β€πŸ’»πŸ‡ΊπŸ‡ΈπŸ‡ͺπŸ‡Έ 17h
I wrote down some thoughts on Open Source Sustainability. It's a hard problem. We need to raise awareness. I'd be much obliged if you'd read and share.
Reply Retweet Like
Michel Weststrate 10h
For the daring ones, it's possible now to run the alpha version of codemod, just to see how MobX will look differently:
Reply Retweet Like
Michel Weststrate 22h
And decorators are still possible, just not default advertised :)
Reply Retweet Like
Michel Weststrate Jun 30
Replying to @jamonholmgren @dzejmsk
It is until someone reports a real use case otherwise :-P (assuming you're using mobx-react-lite)
Reply Retweet Like
Michel Weststrate Jun 30
Writing code is just procrastination from shipping code
Reply Retweet Like
Michel Weststrate Jun 30
Replying to @numToStr @faassen
They aren't. But they won't be the default advertised way anymore.
Reply Retweet Like
Michel Weststrate retweeted
Martijn Faassen Jun 30
MobX 6 is in the making: For a little while now I've been busy happily reorganizing and editing documentation to prepare for it on a branch. Still a while to go but am making progress!
Reply Retweet Like
Michel Weststrate Jun 29
Replying to @lmatteis
I now pulled the reset logic out of the two reducers and put it in the root reducer, so that it can access the mapping. Little funky, but at least it doesn't change call sides and doesn't need untraceable middlewares or something
Reply Retweet Like
Michel Weststrate Jun 29
Replying to @lmatteis
I basically have a reset button, and two reducers that store state that needs resetting. However, the second one stores it based on a different key, so I need to access a third to lookup the mapping. That's really all I need. Surprised how crazily hard that is too solves.
Reply Retweet Like
Michel Weststrate Jun 29
Replying to @lmatteis
It's funny how the only thing I need to do is to throw away a message queue in some unrelated reducer. All solutions offered so far to 'fix' the too much indirection of Redux by adding more layers of indirection :-P. Simple things should be simple, otherwise it smells :)
Reply Retweet Like
Michel Weststrate retweeted
Gorgi Kosev Jun 29
Replying to @Swizec
Honestly, at this point I jump to MobX immediately, even as a replacement for setState. It's more predictable as its synchronous and I don't have to think about which component uses which bits as MobX will automatically optimize that for me.
Reply Retweet Like
Michel Weststrate Jun 29
Replying to @acemarke @zeorin
I think that is a nice principle, but like many principles, best work in hindsight :-). This was a new action that operates purely on already existing state that was so far separated. Like having to tables and now I need a join for some feature
Reply Retweet Like
Michel Weststrate Jun 29
Replying to @DavidKPiano
Yeah I can see how this would work a nicer in an actor model. But afaik actor implementations don't guarantee sync responses(?), which opens a different can of worms.
Reply Retweet Like
Michel Weststrate Jun 29
Replying to @acemarke @zeorin
Root I'll say, since redux reducers aren't really arbitrarily composable anyway. Solved it now by adding a reducer that reduces at the roof the store. Looks to have the least side effects. But probably not very idiomatic either...
Reply Retweet Like
Michel Weststrate Jun 29
Replying to @zeorin
It's not intrinsically a tree problem; references to- or cursors for the parents would solve it neatly. As would making it easy to pull reducers up. So I think it is more of an api design limitation than a technical one.
Reply Retweet Like
Michel Weststrate Jun 29
Replying to @acemarke @zeorin
or a `getParentState`
Reply Retweet Like
Michel Weststrate Jun 29
Replying to @acemarke @zeorin
I think I just want to have a RO version of the state as third arg to my reducers. I have some lookups to perform in data managed by another reducer. But the caller shouldn't be bothered by that as it is an implementation detail (not part of the "what happened event")
Reply Retweet Like
Michel Weststrate Jun 29
Replying to @Canenald
The state design is very sane and worked well so far. But a new feature cuts across 2 concerns, and everything blows up. yeah, I will do 2, as there are not too many call sides, but it is kinda messed up as it will totally leak further unneeded state knowledge into components
Reply Retweet Like
Michel Weststrate Jun 29
Replying to @sebastienlorber
Yeah, but that seems it forces asynchronously to the process, because my first dispatch is not allowed to dispatch something new. Seems trying to separate things gets punished hard. If I kept everything in one reducer, it would have been trivial to do what I want
Reply Retweet Like
Michel Weststrate Jun 29
The promise of event sourcing is that 1 event can be processed by n processes. But as soon as Redux needs to read a piece of state from another reducer for that, everything gets fubar. Shall I 1) pass just the entire state as payload 2) dispatch from first reducer async πŸ€”. Blegh
Reply Retweet Like