Skip to content

SLGShark6/typescript-chain-of-responsibility-implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chain of Responsibility in Typescript

Edit on StackBlitz ⚡️

What is it?

It's just my take at implementing the Chain of Responsibility Pattern in typescript, with a set of sentence handlers. Similar to how Middleware/ Filter chaining is implemented in .Net Core. .Net Core MVC Filters.

Why?

Because I like the simplistic, reusability of this implementation, versus implementations that require you to set the next handler instance on the previous handler instance, Such as this, and I couldn't find a good example googling around.

How do I use it?

Everything of importance is in the index.ts. Just apply the general design concept to whatever it is you're trying to do with the Chain of Responsibility Pattern. I dunno man...