@malgogi-rx-straw/core
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@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(); }
    });

Readme

Keywords

Package Sidebar

Install

npm i @malgogi-rx-straw/core

Weekly Downloads

10

Version

0.1.1

License

MIT

Unpacked Size

18 kB

Total Files

18

Last publish

Collaborators

  • malgogi