Repeated When
See original GitHub issueI have a Idea. There is common pattern in my reactions:
reaction(() => client.online, online => online && ts.sync())
.
Basically, it’s just when
, which is not autodisposes itself on first run. So, it can be done via when
option named (e.g.) repeated
. With it, my code will look as:
when(() => client.online, () => ts.sync(), {repeated: true})
- What problem would it solve for you? Code readability and complexity.
- Do you think others will benefit from this change as well and it should in core package (see also mobx-utils)?
Yep, it just additional
when
option, which can be useful for many cases. - Are you willing to (attempt) a PR yourself? Maybe, it shouldn’t be difficult.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Multiple when/then with where for each other
I want to use in one test method multiple blocks of when/then with where for each block. Is it possible? Or I should...
Read more >Repeat When Necessary - Album by Dave Edmunds
Listen to Repeat When Necessary on Spotify. Dave Edmunds · Album · 1979 · 11 songs.
Read more >Repeat When Necessary
Repeat When Necessary is the fifth album by Welsh rock musician Dave Edmunds. Repeat When Necessary. Repeatwhennecc.jpg · Studio album by. Dave Edmunds....
Read more >Dave Edmunds - Repeat When Necessary Album Reviews, ...
Discover Repeat When Necessary by Dave Edmunds released in 1979. Find album reviews, track lists, credits, awards and more at AllMusic.
Read more >Charactors repeated when typing, eg fffffffffffffffffffffff about x40
Hello Palcouk, I am Jaspreet Singh. ... When the key is pressed once the keyboard on the website key will change to blue...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think the syntactical sugar here is so straight-forward that it doesn’t justify expanding the api for it. Rather, it confuses two concepts which are now clearly deliniated: one time? -> when. Multiple times? -> reaction
Op di 29 jan. 2019 om 14:44 schreef Иван Плесских <notifications@github.com
Closing, the pattern is hopefully so straight forward I don’t see any need to standardize this