0.1.1 • Published 3 years ago
@malgogi-rx-straw/core v0.1.1
@malgogi-rx-straw/core
Description
malgogi-rx-straw is rxjs utility library.
Installation
Using NPM:
npm i --save @malgogi-rx-straw/core
Using YARN:
yarn add @malgogi-rx-straw/core --save
Examples
cron
cron is wrapper function of moment, node-cron
cron('* * * * * *')
.subscribe((utcTimeInMillis: number) => {
console.log(`task was started at ${utcTimeInMillis}`);
// do task
})
circuitBreaker
interval(1000)
.pipe(circuitBreaker<number, number>({
failureThreshold: 30,
execute: (source) => {
// do business logic.
return 1;
},
fallback: () => {
// fail action.
return 2;
},
}))
.pipe(take(3))
.subscribe({
next(item) { console.log('You can get a 1 or 2') },
complete() { done(); }
});
0.1.1-alpha.0
3 years ago
0.1.1
3 years ago
0.1.1-alpha.1
3 years ago
0.0.5
3 years ago
0.0.6
3 years ago
0.0.4
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago
0.0.1-alpha.19
3 years ago