Skip to content

Instantly share code, notes, and snippets.

View buttercubz's full-sized avatar
:shipit:
Working from home

Erick Sosa Garcia buttercubz

:shipit:
Working from home
View GitHub Profile
@buttercubz
buttercubz / mod.ts
Created May 15, 2021 03:15
Match function
export type Fn = () => any;
export function Match<T extends any>(data: T) {
const cases: Array<{ condition: any; action?: Fn }> = [];
let once = true;
return {
case(condition: T, action: Fn) {
cases.push({ condition, action });
return this;
@buttercubz
buttercubz / Deno Module Style Guide.md
Last active May 28, 2021 23:02 — forked from timreichen/Deno Module Style Guide.md
Deno Module And Cli's Development Style Guide