1.0.5 • Published 5 years ago

chain_patternx v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

This is an implementation of chain of responsibilites design pattern in nodejs.

Installation

npm install chain_patternx

Usuage

let person={name:"alex"};

let chain=new Chainer(person);

//here you add new part in the chain 
// update the person object and adding age property
//then call next to go to the next part of the chain

chain.addChain(function(data,next){
    data.age=23
    next()
})

chain.addChain(function(data,next){
    data.phone="1223456789"
    next();
})

chain.addChain((data,next)=>{
    data.gender = "male";
})
chain.start()
                           
1.0.5

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago