Skip to content

Instantly share code, notes, and snippets.

@schrepfler
Created April 22, 2015 18:36
Show Gist options
  • Save schrepfler/71389b9062a3d05cdbb0 to your computer and use it in GitHub Desktop.
Save schrepfler/71389b9062a3d05cdbb0 to your computer and use it in GitHub Desktop.
Cycle on bosonic
<element name="rx-web-component">
<style>
</style>
<template>
</template>
<script>
({
sayHello: function() {
var source = Cycle.Rx.Observable.timer(200, 100)
.timeInterval()
.pluck('interval')
.take(3);
var subscription = source.subscribe(
function (x) {
console.log('Next: ' + x);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
},
createdCallback: function() {
this.textContent = 'Hello';
}
});
</script>
<script src="cycle.js"></script>
</element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment