0.1.15 • Published 9 years ago

mosaic-reactive v0.1.15

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

# mosaic-reactive

A very simple reactive framework inspired by the http://reactivex.io/. Features:

  • 350 lines of code; 8Kb (non minimized)
  • Based on PromiseA-compliant promises; can be used with any external promise implementations.
  • Each stream is a deferred object with resolve/reject/then methods. Main methods:
    • Deferred
    • Stream
  • Provides the following methods:
    • buffered
    • each
    • filter
    • index
    • map
    • merge
    • pipe
    • zip
  • Experimental methods
    • delay
    • interval

Example:

// var Promise = require('promise'); // - not required in NodeJS environment 
var reactive = require('mosaic-reactive');

var source = reactive.Stream(Promise, {
	methods : reactive
});

var out = source.map(function(value) {
	return value.toUpperCase();
}).each(function(value) {
	console.log('* ', value);
});

var array = [ 'first', 'second', 'third', 'fourth', 'fifth' ];
array.forEach(source.emit);
source.end();

return out.then(function() {
	console.log('Finished');
}, function(err) {
	console.log('Error!', err);
});
0.1.15

9 years ago

0.1.14

9 years ago

0.1.13

9 years ago

0.1.12

10 years ago

0.1.11

10 years ago

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.2

10 years ago