Skip to content

Instantly share code, notes, and snippets.

View hazzard993's full-sized avatar

Jason McKenzie hazzard993

View GitHub Profile
@endel
endel / strong-signal-usage.ts
Last active July 19, 2019 20:16
Lightweight Strong Typed Signals in TypeScript
import { createSignal } from "./strong-signal"
// declare the signal
const onNumber = createSignal<(num: number) => void>();
// ok
onNumber(function(num) {});
// compilation error! second argument not allowed
onNumber(function(num, secondArg) {});