plaid / deprecated-async-problem

:twisted_rightwards_arrows: Solutions and non-solutions to JavaScript's async problem
186 stars 28 forks source link

Added pull-streams version of async problem #30

Open kwijibo opened 7 years ago

kwijibo commented 7 years ago

Hi, I've created a pull-stream version of the Async Problem. It's my first time using the pull-stream libraries, so there may be a neater way of writing it.

davidchambers commented 7 years ago

Does all the code need to live in main, @kwijibo? I ask because we already have lots of examples of approaches which fail to separate the pure transformations from the impure code. :stuck_out_tongue_winking_eye:

kwijibo commented 7 years ago

You can compose and modularise pull-streams pretty well it seems - I managed to move some stuff out. It would be nice though, if there were something like a parachain in order to use the same file() pull stream in both steps. I'm not sure what I think of pull-streams as a solution (to this particular problem), I just wanted to get a feel for them.

davidchambers commented 7 years ago

I appreciate the pull request, @kwijibo. I'd like to avoid reaching the point where there are dozens of examples which do not satisfy the requirements distracting from the one or two examples which do satisfy the requirements. As a result I'd like to leave this pull request open indefinitely, so that those interested in pull-stream may find it.