This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

rx-conditional-next
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

rx-conditoinal-next

Update your RxJS BehaviorSubject if and only if conditoins are fullfilled

Usage

For extended excamples, see main.spec.ts

const bs = new BehaviorSubject<any>('Hello');

conditionalNext(bs, 'World'); //  => bs.value === 'World'
conditionalNext(bs, 'World 2', (newVal, prevVal)  => newVal !== prevVal); // => bs.value === 'World'
conditionalNext(bs, 'World 2'); // no change, bs.value still === 'World 2' 

conditionalNext(bs, 'World 3').onNext(()) => 'tell med what to do').onStop(() => 'is not called');
conditionalNext(bs, 'World 3').onNext(()) => 'is not called').onStop(() => 'tell med what to do');

Test

$> npm i && npm test

Dependencies

Your project should have its own rxjs, it's omitted to avoid version conflicts.

Package Sidebar

Install

npm i rx-conditional-next

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

6.06 kB

Total Files

6

Last publish

Collaborators

  • hansogj