Socket
Socket
Sign inDemoInstall

saibo

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    saibo

Simple reactive programming.


Version published
Weekly downloads
0
Maintainers
1
Install size
5.07 kB
Created
Weekly downloads
 

Readme

Source

Saibo

A simple library for reactive programming

Saibo lets you make a network of cells (like a key-value store).

Cells can either hold a value, or a formula that derives their value from other cells.

Cells can trigger event listeners when their values change.

Formulas can use values from other cells, with their values updating and triggering event handler when cells they depend on change.

Cells can have a timer function to set their value at a regular interval.

var cells = new Saibo();

cells.set('width', 10);
cells.set('height', 10);

console.log(cells.val('width')); // 10

// calculate area from width * height
cells.add('area')
  .formula(function(width, height){
    return width * height;
  }, ['width','height']);

// when area changes, call function
cells.on('area', function(x){
  console.log('Area', x);
});

cells.set('width', 20);

// Area 200
cells.on('time', function(x){
  console.log(x);
});

cells.set('time', 0)
  .timer(1000, function(){
    return Number(this.val()) + 1;
});

Keywords

FAQs

Last updated on 16 Sep 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc