rxjs-property
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Reactive Property with rxjs

Wrap rxjs Subject to allow access to the most recently emitted value.

Installation

npm install rxjs-property

Usage

const ReactiveProperty = require('rxjs-property');

const booleanProp = new ReactiveProperty(false);

const subscription = booleanProp.subscribe(x => {
    console.log(x);
});

booleanProp.value = true; // >> true;
booleanProp.value = true; // no output

booleanProp.setValueAndForceNotify(true); // >> true;
booleanProp.value = false; // >> false;

subscription.unsubscribe();
booleanProp.value = true; // no output

// As observable
const observable = booleanProp.observable();

TypeScript

import ReactiveProperty from 'rxjs-property';

const booleanProp = new ReactiveProperty<boolean>(false);

Package License

This software is released under the MIT License. https://opensource.org/licenses/mit-license.php

Copyright (c) 2023 ina-amagami / Amagamina Games, Inc. (ina@amagamina.jp)

Readme

Keywords

none

Package Sidebar

Install

npm i rxjs-property

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

4.64 kB

Total Files

6

Last publish

Collaborators

  • ina-amagami