Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/jotai/src/vanilla.ts>createStore

👻 Primitive and flexible state management for React
Go to Latest
variable createStore
import { createStore } from "https://deno.land/x/jotai@v2.0.4/src/vanilla.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

() => unknown