From f2889840a9e351b162f37d86352b8865bf5bba6c Mon Sep 17 00:00:00 2001 From: Ada Lundhe Date: Sun, 10 Mar 2024 14:32:12 -0500 Subject: [PATCH] AL: reduce API to just stores and add async/Suspense support --- examples/async.ts | 21 --------------------- examples/example.ts | 2 +- examples/pokemon.ts | 1 - 3 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 examples/async.ts diff --git a/examples/async.ts b/examples/async.ts deleted file mode 100644 index 8b50b01..0000000 --- a/examples/async.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { atom } from "../src/async"; - -const test = async () => { - const atomTwo = await atom(0); - const atomThree = await atom(0); - - atomThree.subscribe((count) => { - atomTwo.set(count + atomTwo.get()); - console.log(count); - }); - - atomThree.set(1); - atomThree.set(1); - atomThree.set(1); - - console.log(atomThree.get()); - - console.log(atomTwo.get()); -}; - -test(); diff --git a/examples/example.ts b/examples/example.ts index e29ccce..17ae38c 100644 --- a/examples/example.ts +++ b/examples/example.ts @@ -1,5 +1,5 @@ import { link } from "fs"; -import { create, atom, AtomHook, useAtom, DerivedAtom } from "../src"; +import { create } from "../src"; interface Store { counter: number; diff --git a/examples/pokemon.ts b/examples/pokemon.ts index 6d25db9..93e4eb3 100644 --- a/examples/pokemon.ts +++ b/examples/pokemon.ts @@ -1,5 +1,4 @@ import { create } from "../src"; -import { useState } from "react"; interface PokemonTrainer { trainerName: string;