1.0.2 • Published 5 months ago

rxjs-property v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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)

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago