A Great Class to Extend! It has built in support to make reactive any/all class properties and their nested leaves.
 
Go to file
Kebler Network System Administrator 543cad8bac using new private methods and fields
added testing
using new obj-nested-prop module functions
2021-05-09 21:05:07 -07:00
examples 0.1.4 added option to disable emitter 2020-06-17 11:57:02 -07:00
src using new private methods and fields 2021-05-09 21:05:07 -07:00
test using new private methods and fields 2021-05-09 21:05:07 -07:00
.babelrc using new private methods and fields 2021-05-09 21:05:07 -07:00
.eslintrc.js A working class, only missing the tested hook and operator support 2020-06-07 21:56:54 -07:00
.eslintrc.yml using new private methods and fields 2021-05-09 21:05:07 -07:00
.gitignore A working class, only missing the tested hook and operator support 2020-06-07 21:56:54 -07:00
.npmignore A working class, only missing the tested hook and operator support 2020-06-07 21:56:54 -07:00
.npmrc using new private methods and fields 2021-05-09 21:05:07 -07:00
nodemon.json A working class, only missing the tested hook and operator support 2020-06-07 21:56:54 -07:00
package.json using new private methods and fields 2021-05-09 21:05:07 -07:00
readme.md using new private methods and fields 2021-05-09 21:05:07 -07:00

readme.md

uCOMmandIt Reactive Class

A Great Class to Extend! It has built in support to make reactive any/all class properties and their nested leaves.

ES2021 Dependency

Not running nodejs 16+ which supports much of ES2021+? then STOP you can't use this class! It contains both private fields and methods and is written with esm modules. You might be able to transpile it but that is not supported nor encouraged.

Why?

To allow and object to have reactivity similar to vue and react without those packages and thus with any nodejs code. This a "backend" app could maintain app settings and allow non vue/react "clients" to get updated values when the app changes state. Essentially this class will create instances of 'mini' state event bus.

Features

Will both emit and allow subscriptions to any property (i.e. object path) that has been made reactive.

Allows custom registration of an unlimited number of state change event hooks.

Allows additional rxjs operators for the pipe of the observer for each property.

See Examples folder

How

The class maintain a private rx field. When an object (i.e. property) of the class is made reactive it is converted into a getter/setter (much like vue) and it's actual value is stored within the private rx field. One can access the value of that propery like before but