question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I 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:closed
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mweststratecommented, Jan 29, 2019

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

:

I 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.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mobxjs/mobx/issues/1886, or mute the thread https://github.com/notifications/unsubscribe-auth/ABvGhNAAf-KaEzD8wiGc6CgvoVXIBrp3ks5vIFAlgaJpZM4aYE2i .

1reaction
mweststratecommented, Feb 6, 2019

Closing, the pattern is hopefully so straight forward I don’t see any need to standardize this

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found