Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am patrickjuchli on github.
  • I am patrickjuchli (https://keybase.io/patrickjuchli) on keybase.
  • I have a public key ASDzEO5MH0UEpuTyRcZIvV3QNaIAyNUEvdn2wW-ekcbpUwo

To claim this, I am signing this object:

@patrickjuchli
patrickjuchli / Notifier.ts
Created February 25, 2017 15:09
Simple notifier for Peter
interface Handler<T> {
(payload: T);
}
export default class Notifier<T> {
protected handlers: Set<Handler<T>> = new Set();
subscribe(handler: Handler<T>) {
this.handlers.add(handler);
}
import Foundation
/**
Set FourCharCode/OSType using a String.
Examples:
let test: FourCharCode = "420v"
let test2 = FourCharCode("420f")
print(test.string, test2.string)
*/