🚀🚀
Size: a a a
🚀🚀
🚀🚀
🚀🚀
🚀🚀
R
🚀🚀
const abort = createEvent()
const fx = createEffect(({id}) => new Promise((rs, rj) => {
const stop = abort.watch(abortId => {
if (abortId === id) {
stop()
rj(Error('AbortError'))
}
})
fn().then(
val => {
stop()
rs(val)
},
err => {
stop()
rj(err)
}
)
}))
🚀🚀
🚀🚀
🚀🚀
R
const abort = createEvent()
const fx = createEffect(({id}) => new Promise((rs, rj) => {
const stop = abort.watch(abortId => {
if (abortId === id) {
stop()
rj(Error('AbortError'))
}
})
fn().then(
val => {
stop()
rs(val)
},
err => {
stop()
rj(err)
}
)
}))
🦜
🦜
R
R
R
🦜
🦜
R
R
ф
controller.onCancel
то можно, в принципе, любой эффект отменять