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 assert = f => ([a, b]) => | |
| (x => x === b | |
| ? { passed: true } | |
| : { | |
| failed: true, | |
| message: `- expected f(${a}) to be ${b}, but was ${x}` | |
| } | |
| )(f(a)) | |
| const runTests = (cases, f) => { |
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
| // :: delimitGroups = (number, string) => string => string | |
| const delimitGroups = (groupSize, delimiter) => s => | |
| s.split('') | |
| .reduceRight((acc, x, i) => | |
| `${x}${(s.length - 1 - i) % groupSize ? '' : delimiter}${acc}`) | |
| // :: format = number => object => string | |
| export const format = options => n => | |
| (([left, right]) => | |
| `${options.symbol}${ |
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
| http://jsbin.com/capeyinite/edit?output |
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
| class Observable { | |
| constructor(value) { | |
| this.value = value | |
| this.events = { change: [] } | |
| } | |
| update(updateFn) { | |
| this.value = updateFn(this.value) | |
| this.events.change.forEach(fn => fn(this.value)) | |
| } |
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
| class Observable { | |
| constructor(value) { | |
| this.value = value | |
| this.events = { change: [] } | |
| } | |
| update(updateFn) { | |
| this.value = updateFn(this.value) | |
| this.events.change.forEach(fn => fn(this.value)) | |
| } |
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> | |
| <html> | |
| <head> | |
| <meta name="description" content="a vanilla js + html & css analog clock"> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <link href="https://fonts.googleapis.com/css?family=Share+Tech+Mono" rel="stylesheet"> | |
| <style id="jsbin-css"> | |
| body { |
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> | |
| <html> | |
| <head> | |
| <meta name="description" content="grouping dynamically generated datasets"> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.24.1/ramda.min.js"></script> |
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> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> |
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> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| <style id="jsbin-css"> | |
| #app { | |
| font-family: 'Courier' | |
| } |
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
| class Router { | |
| routes = {} | |
| baseUrl = "" | |
| constructor(baseUrl) { | |
| this.baseUrl = baseUrl | |
| } | |
| register = (method) => { |