Saphyra Docs

Suspense Integration

Learn how to integrate Saphyra with Suspense

Code example

const newTodoStore = newStoreDef({
  reducer({ state, set, diff, async, deps, action }) {
    if (action.type === "add-todo") {
      async().promise(async ({ signal }) => {
        await deps.addTodo(action.todo, signal)
      })
    }
  },
})

On this page