Skip to content

Instantly share code, notes, and snippets.

View tuucan's full-sized avatar

Tuğcan Karabörk tuucan

View GitHub Profile
@tuucan
tuucan / ChainOfResponsibility.ts
Last active December 19, 2019 11:12
Typescript implementation of chain of responsibility pattern
interface Handler<T> {
setSuccessor: (successor: T) => void;
handle(...args: any): void;
}
/**
* Abstract base class for handlers
* hadnles setting and calling successors
* */