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
const FILTER_TYPE_ERROR_STATES = { | |
type: "parallel", | |
states: { | |
FILTER_TYPE_SVALUE: { | |
initial: "OFF", | |
states: { | |
OFF: { | |
on: { | |
CLICK_TYPE_SVALUE: "ON", | |
}, |
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
const FILTER_TYPE_ERROR_STATES = { | |
type: "parallel", | |
states: { | |
FILTER_TYPE_SVALUE: { | |
initial: "OFF", | |
states: { | |
OFF: { | |
on: { | |
CLICK_TYPE_SVALUE: "ON" | |
} |
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
const replMachine = Machine({ | |
id: 'replMachine', | |
initial: 'repl', | |
context: { | |
cursor: 0, | |
data: [1,2,3,4,5] | |
}, | |
states: { | |
repl: { |
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
const euclid = (w, h) => h === 0 ? w : euclid(h, w % h) |
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
/* @param alpha boolean | |
* if true a random value for the alpha channel is calculated, else alpha channel = 1 (full saturation) | |
*/ | |
var randomPastelColor = function (alpha) { | |
var rndm = function (f) { return Math.floor(Math.random() * f)}, | |
pstlfy = function (p) { return Math.round((p + 255) / 2)}, | |
r = pstlfy(rndm(256)), | |
g = pstlfy(rndm(256)), | |
b = pstlfy(rndm(256)), | |
a = alpha ? rndm(11) / 10 : 1 |