These are chat archives for ractivejs/ractive

7th
Jul 2018
Cerem Cem ASLAN
@ceremcem
Jul 07 2018 11:37
question: how practical do you think to have a SignalBranch class that will be used for joining async calls, like so:
branch = new SignalBranch
console.log "branch is splitted"
for let x in my-array 
    signal = branch.add!
    console.log "fetching async data #{x}"
    err <~ @fetch-async
    console.log "fetched async data #{x}"
    signal.go!
err, res <~ branch.joined
console.log "branch is joined"
question is that is it worth to make the SignalBranch available via NPM
in other words, do ES6 already solve this split/join problem of async calls (await is not a direct solution here)
Cerem Cem ASLAN
@ceremcem
Jul 07 2018 11:45
(here both SignalBranch and Signal classes are able to have their own timeout property to decide to wait whether indefinitely or for a specific amount of time)
Chris Reeves
@evs-chris
Jul 07 2018 13:22
looks kinda like an abstraction over promises
if it works with workers, then yeah, I'd say there's definitely some demand for something similar that will pick up when workers fully land in node 11 or 12
Cerem Cem ASLAN
@ceremcem
Jul 07 2018 17:03
kinda, yes
Cerem Cem ASLAN
@ceremcem
Jul 07 2018 17:13
I guess it can work with anything, because it just uses objects and timers