@angx-o/dispatcher
v1.0.2
Published
a middleware dispatcher.
Downloads
2
Readme
a simple middleware dispatcher
import { Dispatcher } from "@angx-o/dispatcher"
const dispatcher = new Dispatcher();
dispatcher.use(
async (next) => {
console.log(1);
await next();
console.log(2);
},
console.log(3);
await next();
console.log(4);
}
)
dispatcher
.dispatch(async () => {
console.log(5)
})
.then(() => {
console.log(6)
})
// output 1 3 5 4 2 6