Can flyd streams be made lazy ?
See original GitHub issuewhen you have nodejs style API, you have this:
var fs = requie('fs');
var flyd = requie('flyd');
var read_hello = flyd.stream();
fs.readfile('./hello.txt',read_hello); // <- this runs immediately :(
read_hello.map(function(){/...../});
Is there some magic I can do to turn the stream upside down to make it lazy ?
var fs = requie('fs');
var flyd = requie('flyd');
var read_hello = flyd.stream();
read_hello = flyd.lazy(function(stream){
fs.readfile('./hello.txt',stream);
});
read_hello.map(function(){/...../}).run(); // <- runs here !
Cheers !
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Stream and lazy evaluation - java - Stack Overflow
Streams are lazy because intermediate operations are not evaluated unless terminal operation is invoked. Each intermediate operation creates a ...
Read more >Java 8 Streams - Lazy evaluation - LogicBig
Streams are lazy because intermediate operations are not evaluated until terminal ... The pipeline accumulates these newly created streams.
Read more >Java 8 Streams Lazy evaluation - LinkedIn
Streams are lazy because intermediate operations are not evaluated until terminal operation is invoked. Each intermediate operation creates ...
Read more >Why Java 8 Streams Are Lazy Explain ? | InterviewDOT
Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications.Why Java 8 Streams Are Lazy ...
Read more >Is Vaush getting lazy or giving up? : r/VaushV - Reddit
It's starting to show with his video/stream view-count as well. He is still my favourite streamer but I was wondering if you guys...
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
don’t worry, I understand what you’re trying to accomplish.
I’m curious about your use case though, what use case do you have that requires lazy streams?
Hey @sourcevault ! Glad you found a solution!
I think you might be able to make a generic nodeback -> Stream function.
Then you could use that as: