effects

This package is inspired by sagas and give you advanced effect management solutions.

included in @reatom/framework

take

Allow you to await an atom update.

const count = await take(ctx, countAtom)

Allow you to await an action call.

openModal(ctx)
await take(ctx, closeModal)
sendData(ctx)

takeNested

Allow you to await all dependent effects.

// SSR
await takeNested(ctx, (trackedCtx) => {
  // all router subscribers witch uses `schedule` will be awaited
  router.push(trackedCtx, req.url)
})
render()