Created
April 22, 2015 18:36
-
-
Save schrepfler/71389b9062a3d05cdbb0 to your computer and use it in GitHub Desktop.
Cycle on bosonic
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
<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