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