Skip to content

Instantly share code, notes, and snippets.

@PaulieScanlon
Created April 22, 2024 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PaulieScanlon/3efa670694fb186eaf147afcdfa4ea2d to your computer and use it in GitHub Desktop.
Save PaulieScanlon/3efa670694fb186eaf147afcdfa4ea2d to your computer and use it in GitHub Desktop.
Example of state diff
// src/state/index.ts
import { atom } from 'jotai';
export const countAtom = atom(0);
export const objectAtom = atom({
foo: 'bar',
test: true,
});
+ export const userAtom = atom({
+ isLoggedIn: false,
+ isAdmin: false,
+ });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment