Skip to content

LancerComet/flow.data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flow.Data

A tiny data toolkit for storing & sharing data.

Under construction.

Usage.

// Create flow item.
const info = FlowData.createItem('info', {
  name: 'myName', age: 10
})

// Subscribe it to watch changing.
info.subscribe('name', function (newVal) {
  console.log('info.name has been changed: ', newVal)
})

info.subscribe('age', function (newVal) {
  console.log('info.age has been changed: ', newVal)
})

// Update value.
// Both methods are ok.
info.name = 'John Hathway'
info.age = 10000

info.update('name', 'John Smith')
info.update('age', 20000)

// You can get a flow item by using Flow.getItem()
const info = FlowData.getItem('info')
// Do something else ...

About

A tiny data toolkit for storing & sharing data.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages