🚀🚀
Size: a a a
🚀🚀
IK
🚀🚀
🚀🚀
🚀🚀
const e = createEvent()
const $a = createStore(0)
const $b = $a.map(x => x + 1)
$a.on(e, (x, fail) => {
if (fail) throw Error()
return x + 1
})
e()
// => $a = 1; $b = 2
e(true)
// => нет реакции, но всё консистентноK
EГ
АБ
ei
EГ
АХ
sample({
source,
clock,
filter,
fn,
target
})🚀🚀
const fx = createEffect(() => 1)
const att = attach({
effect: fx,
mapParams(fail) {
if (fail) throw Error()
}
})
const req1 = att()
// Promise {fullfilled: 1}
const req2 = att(true)
// Promise {pending}
EГ
DS
🚀🚀
DS
🚀🚀
🚀🚀