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

1.0.4Β β€’Β PublicΒ β€’Β Published

  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—
 β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•
 β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘  β•šβ–ˆβ–ˆβ–ˆβ•”β•
 β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β•šβ•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•   β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ•”β–ˆβ–ˆβ•—
 β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘  β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•—
  β•šβ•β•β•β•β•β•  β•šβ•β•β•β•β•β•  β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β•β• β•šβ•β•  β•šβ•β•   β•šβ•β•β•β•   β•šβ•β•  β•šβ•β•

ObservX ⚑️

Tini-Tiny Observer creating library. Not even sure it achievs that goal but surely does something πŸ˜†

Installation πŸ“‚

$Β npmΒ iΒ --saveΒ observx

Usage πŸ“‘

Β 
constΒ {Β subscribeΒ }Β =Β require("observx")
Β 
varΒ streamedDataΒ =Β subscribe([12,Β 323,Β 233],Β resΒ =>Β {
Β Β console.log("changed");
});
console.log(streamedData.currentData());Β //Β [12,Β 323,Β 233]
streamedData.changeWith([2]);
console.log(streamedData.currentData());Β //Β [2]
Β 
Β 

API πŸ’Š

subscribe(data[,onchangeCB])

the subscribe method takes one required argument which is the observables or the data and one optional callback which is called everytime any changes happens to the observer. It returns a observer

The callback onchangeCB will give a response argument which is a object consisting the data and the type of the data

{Β data,Β newdata,Β typeOfData:Β typeofΒ dataΒ }

subcribe().changeWith(newData)

this method takes a argument with which it will change the existing data. It will return the newdata which is replaced with

subcribe().currentData()

It will simply return the current data (observables).

## Note Still Need some refactoring and fixing for the APIs and the subscribe method πŸŽ“

Readme

Keywords

none

Package Sidebar

Install

npm i observx

Weekly Downloads

0

Version

1.0.4

License

none

Unpacked Size

9.1 kB

Total Files

5

Last publish

Collaborators

  • anixsaha