rx-map

0.1.2 • Public • Published

Rx Map

An Rx based map implementation

Example

var Rx    = require("rx");
var RxMap = require("rx-map");
 
var map = new RxMap();
 
map.subscribe(function(data) {
    console.log("map updated: " + data.key + " => " + data.value);
});
 
map.set("morning", "coffee");
map.set("afternoon", "espresso");
map.set("night", "tea");
 
map.get("morning").subscribe(console.log);
 
map.getOrElse("yesterday", function() {
    return Rx.Observable.returnValue("nothing");
}).subscribe(console.log);
 
map.putIfAbsent("yesterday", function() {
    return Rx.Observable.returnValue("beer");
}).subscribe(console.log);
 

Readme

Keywords

none

Package Sidebar

Install

npm i rx-map

Weekly Downloads

10

Version

0.1.2

License

none

Last publish

Collaborators

  • josephmoniz