Skip to content

Instantly share code, notes, and snippets.

View GarrettCannon's full-sized avatar
🎃

Garrett Cannon GarrettCannon

🎃
  • Mangomint
  • Michigan
View GitHub Profile

Keybase proof

I hereby claim:

  • I am garrettcannon on github.
  • I am gcannon (https://keybase.io/gcannon) on keybase.
  • I have a public key ASAiL3LgqXPhkqJWtLKetRGQsqMk-bpw7TLREOOJjVn2UQo

To claim this, I am signing this object:

@GarrettCannon
GarrettCannon / Store.ts
Last active February 2, 2021 17:40
Svelte Elm like state management using built in Svelte stores
import { writable, Writable, get } from "svelte/store";
type Dispatch<A> = (action: A) => void;
type CmdEff<A> = () => Promise<A | undefined>;
type CmdNone = "CmdNone";
type Cmd<A> = CmdEff<A> | CmdNone;
export const cmdNone: CmdNone = "CmdNone";