reactive-replica
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -155,2 +155,19 @@ 'use strict'; | ||
/** Creates Rx.Observable as if it is a listener to both create and change. | ||
TODO: redesign the whole Place so that notifications are not based on Listeners, but directly on Observables. | ||
*/ | ||
}, { | ||
key: 'from', | ||
value: function from(path) { | ||
var result = new Rx.ReplaySubject(1); | ||
this.listen({ | ||
create: true, | ||
change: function change(after, before) { | ||
result.next(after); | ||
} | ||
}); | ||
return result; | ||
} | ||
/** Server-side model's name.*/ | ||
@@ -157,0 +174,0 @@ |
18
index.js
@@ -143,2 +143,20 @@ | ||
/** Creates Rx.Observable as if it is a listener to both create and change. | ||
TODO: redesign the whole Place so that notifications are not based on Listeners, but directly on Observables. | ||
*/ | ||
from( | ||
path | ||
) | ||
{ | ||
let result = new Rx.ReplaySubject( 1 ) | ||
this.listen( { | ||
create : true, | ||
change : function( after, before ) | ||
{ | ||
result.next( after ) | ||
} | ||
} ) | ||
return result | ||
} | ||
/** Server-side model's name.*/ | ||
@@ -145,0 +163,0 @@ name = undefined |
{ | ||
"name": "reactive-replica", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Helps structure logic around model changes, i.e. utilize reactive style.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
56067
1648