Is there any method like `most.defer()` and `most.create()`?
See original GitHub issueI did not find most.defer()
and most.create()
in the API docs.
I need to defer a function call until it is subscribed.
most.defer(() => {
result = getResult();
return most.of(result);
})
How do I do to achieve my goal?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Defer Keyword in Golang - GeeksforGeeks
In Go language, defer statements delay the execution of the function or method or an anonymous method until the nearby functions returns.
Read more >What Does Mono.defer() Do? - Baeldung
Here, we'll look at the use of the defer method to delay the execution of a Mono publisher.
Read more >The defer keyword in Swift: try/finally done right
Swift's defer keyword lets us set up some work to be performed when the current scope exits. For example, you might want to...
Read more >Scripts: async, defer - The Modern JavaScript Tutorial
Just like defer , the async attribute is ignored if the <script> tag has no src . Dynamic scripts. There's one more important...
Read more >Defer, Panic, and Recover - The Go Programming Language
A defer statement pushes a function call onto a list. The list of saved calls is executed after the surrounding function returns. Defer...
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 FreeTop 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
Top GitHub Comments
Yep, that’s correct. Closing since I believe this answers the original question.
Cheers!
Using
defer
to keep the impure function to be called only when it is subscribed. It’s important if the timing matters.I did not try this, but it seems OK if the function
f
passed to thecontinueWith()
only be called when subscribed. Thanks for your help.