This package has been deprecated

Author message:

Moved to josm

front-db
TypeScript icon, indicating that this package has built-in type declarations

1.1.10 • Public • Published

Front db

f-db is a functional based Observable implementation, with a focus on managing state of complex data types (object / arrays). This is especially usefull to responde declaratively to internally (complex UI) or externally (server-side-events / WebSockets) changing application-data.

Please not that front-db is currently under development and not yet suited for production

Example

Data is a simple Observable of any primitive property

import { Data } from "front-db"
 
let numData = new Data(0)
 
let subscription = numData.subscribe((numVal) => {
  console.log(numVal)  // 0 | 100 | 200
}, /*optinal: initialize: */ true)
 
numData.val = 100
numData.val = 200
 
//current value
console.log(numData.val) // 200
 
numData.unsubscribe(subscription)

A DataBase is a collection (object) of Data instances.

import { Data, DataBase } from "front-db"
 
let db = new DataBase()
 

Conribute

All feedback is appreciated. Create a pull request or write an issue.

Readme

Keywords

Package Sidebar

Install

npm i front-db

Weekly Downloads

2

Version

1.1.10

License

ISC

Unpacked Size

42.1 kB

Total Files

12

Last publish

Collaborators

  • zzrv