0.1.15 • Published 8 years ago

mosaic-reactive v0.1.15

Weekly downloads
2
License
MIT
Repository
github
Last release
8 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

8 years ago

0.1.14

8 years ago

0.1.13

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.2

8 years ago