These are chat archives for canjs/canjs

3rd
Apr 2018
Andrey Furs
@yganda
Apr 03 2018 12:16
Hi all, maybe someone can help me with promiseAll issue in canjs:
i have 2 promises in my component, they seems like
firstPromise: {
get() {
return Component.getList({
id: this.id
})
}
},
secondPromise: {
get() {
return Component2.getList({
id: this.id
})
}
},
promiseAllPromise: {
get() {
return new Promise.all(this.firstPromise, this.secondPromise)
}
}
so, after some data changes both first promises reruns, but promise all never runs again, only once. Maybe i can do something for run it after data changes?
Chasen Le Hara
@chasenlehara
Apr 03 2018 17:14
@ayhanout Not quite sure what you mean, could you give an example?
@yganda Not sure if it matters, but I think promiseAllPromise should return Promise.all([this.firstPromise, this.secondPromise]) (no new and pass it an array instead of multiple arguments)
Gregg Roemhildt
@roemhildtg
Apr 03 2018 21:26
It would be super cool if canjs had something like this repl: https://svelte.technology/repl?version=1.60.0&gist=f5a127d9c21f529016d434dcbe405c3f
Chasen Le Hara
@chasenlehara
Apr 03 2018 22:28
@roemhildtg The menu for selecting examples is pretty cool. What else do you like in that repl?
With the new ES module stuff: https://canjs.com/doc/guides/advanced-setup.html
…we’ve talked a little bit about how we want to show all our examples. I opened up this issue about it: canjs/canjs#4059
Gregg Roemhildt
@roemhildtg
Apr 03 2018 22:29
I'd say being able to save as a gist is pretty useful. That and being able to visualize/live-edit the data is pretty sweet.
Chasen Le Hara
@chasenlehara
Apr 03 2018 22:30
Hm yeah, the gist saving is kinda cool
Gregg Roemhildt
@roemhildtg
Apr 03 2018 22:32
It just feels very polished. JSBin is functionally equivalent but the REPL offers a more streamlined experience.
Chasen Le Hara
@chasenlehara
Apr 03 2018 22:48
Agreed