Created
June 10, 2015 14:56
-
-
Save mezigh/a6c5c63b0f147d485c9f to your computer and use it in GitHub Desktop.
JS Bin RxJS on the workbench // source http://jsbin.com/fatofa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="RxJS on the workbench"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/2.3.22/rx.all.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
console.clear(); | |
var reserv = ["one","two"]; | |
Array.observe(reserv, function (changes) { | |
var source = Rx.Observable.create(function (observer) { | |
reserv.forEach(function (el) { | |
observer.onNext(el); | |
}); | |
observer.completed(); | |
return function () { | |
console.log("DISPOSE"); | |
}; | |
}); | |
var subscribtion = source.subscribe( | |
function (el) { | |
console.log("Next Item: " + el + " at: " + Date()); | |
}, | |
function (error) { | |
console.log("ERRROR !"); | |
}, | |
function () { | |
console.log("COMPLETLY DONE !!!"); | |
} | |
); | |
}); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">console.clear(); | |
var reserv = ["one","two"]; | |
Array.observe(reserv, function (changes) { | |
var source = Rx.Observable.create(function (observer) { | |
reserv.forEach(function (el) { | |
observer.onNext(el); | |
}); | |
observer.completed(); | |
return function () { | |
console.log("DISPOSE"); | |
}; | |
}); | |
var subscribtion = source.subscribe( | |
function (el) { | |
console.log("Next Item: " + el + " at: " + Date()); | |
}, | |
function (error) { | |
console.log("ERRROR !"); | |
}, | |
function () { | |
console.log("COMPLETLY DONE !!!"); | |
} | |
); | |
}); | |
</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.clear(); | |
var reserv = ["one","two"]; | |
Array.observe(reserv, function (changes) { | |
var source = Rx.Observable.create(function (observer) { | |
reserv.forEach(function (el) { | |
observer.onNext(el); | |
}); | |
observer.completed(); | |
return function () { | |
console.log("DISPOSE"); | |
}; | |
}); | |
var subscribtion = source.subscribe( | |
function (el) { | |
console.log("Next Item: " + el + " at: " + Date()); | |
}, | |
function (error) { | |
console.log("ERRROR !"); | |
}, | |
function () { | |
console.log("COMPLETLY DONE !!!"); | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment