Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/jotai/src/vanilla/store.ts>createStore

👻 Primitive and flexible state management for React
Latest
variable createStore
import { createStore } from "https://deno.land/x/jotai@v2.8.4/src/vanilla/store.ts";

Create a new store. Each store is an independent, isolated universe of atom states.

Jotai atoms are not themselves state containers. When you read or write an atom, that state is stored in a store. You can think of a Store like a multi-layered map from atoms to states, like this:

// Conceptually, a Store is a map from atoms to states.
// The real type is a bit different.
type Store = Map<VersionObject, Map<Atom, AtomState>>

type

() => Store