new Emitter({
run(me){
me.send(1)
me.send(2)
me.send(3)
me.resolve()
}
})
It's common to write code in JavaScript as follows:
const foo = require('foo')
module.exports = function bar(){
foo.doSomething()
}
This file contains hidden or 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
// before (waitUntil) | |
self.addEventListener('install', function(event) { | |
event.waitUntil( | |
caches.open('simple-sw-v1').then(function(cache) { | |
return cache.addAll([ | |
'./', | |
'style.css', | |
'logging.js' | |
]) | |
}) |
This file contains hidden or 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
const o = emitterify() | |
, stream1 = emitterify() | |
, stream2 = emitterify() | |
// without | |
o.on('primary') | |
.map(d => console.log(d)) // stream1, stream2 | |
// with | |
o.on('primary') |
This file contains hidden or 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
<style> | |
#a, #b { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 20%; | |
height: 100px; | |
text-align: center; | |
line-height: 100px; | |
background: red; |
This file contains hidden or 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> | |
<body> | |
<textarea-native class=""></textarea-native> | |
<textarea-d3-native class=""></textarea-d3-native> | |
<li-d3 class=""></li-d3> | |
<textarea-d3 class=""></textarea-d3> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
// works.. |