Skip to content

Instantly share code, notes, and snippets.

View tyler-boyd's full-sized avatar

Tyler Boyd tyler-boyd

  • TradeRev
  • Toronto, ON
View GitHub Profile
@tyler-boyd
tyler-boyd / stores.ts
Created February 15, 2022 21:52
Svelte stores in Stencil
import { createStore } from '@stencil/store';
export type Dispatch<T> = (value: T) => void;
export type Updater<T> = (value: T) => T;
export type Mutater<T> = (value: T) => void;
export interface Readable<T> {
subscribe: (subscription: Dispatch<T>) => void;
get: T; // fancy observer shit
}