1 source, Three subscribers
Subscriber 1 subscribes and source starts emitting
Subscriber 2 subscribes halfway
Subscriber 3 subscribes after source has completed.
import Rx from 'rxjs/Rx';
var data = [];
1 source, Three subscribers
Subscriber 1 subscribes and source starts emitting
Subscriber 2 subscribes halfway
Subscriber 3 subscribes after source has completed.
import Rx from 'rxjs/Rx';
var data = [];
// this will be much more efficient than $watch() | |
app.factory('FilteredArray', function($firebaseArray) { | |
function FilteredArray(ref, filterFn) { | |
this.filterFn = filterFn; | |
return $firebaseArray.call(this, ref); | |
} | |
FilteredArray.prototype.$$added = function(snap) { | |
var rec = $firebaseArray.prototype.$$added.call(this, snap); | |
if( !this.filterFn || this.filterFn(rec) ) { | |
return rec; |
/********************* | |
** I Dream in Code ** | |
*********************/ | |
while( I .sleep() ) { | |
I.dream() in code; | |
I.dream() in algorithms; | |
I.dream() in subroutines; | |
Rewind.age(5) && I.dream.of(["missing pants", "driving hotwheels", "peeing in fountains"]) ); //hint: it’s my bed |
// Requires JQuery and CORS enabled for the Origin you're testing from. | |
// Uncomment the next 4 lines to import JQuery | |
// var script= document.createElement('script'); | |
// script.type= 'text/javascript'; | |
// script.src= '//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js'; | |
// document.head.appendChild(script); | |
// Set up the multipart form using HTML5 FormData object | |
// https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/FormData | |
var form = new FormData(); |