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
Powered* | |
powerFail -> Unpowered | |
Green* | |
tick -> Yellow | |
Yellow | |
tick -> Red | |
Red | |
tick -> Green | |
Unpowered |
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 dataCollectionStates = { | |
id: 'dataCollectionStates', | |
initial: 'idle', | |
states: { | |
idle: { | |
on: { | |
CHANGE: { | |
target: 'idle', | |
actions: ['updateValue'], | |
}, |
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 sliderMachine = new Machine({ | |
id: 'sliderMachine', | |
initial: 'idle', | |
context: {}, | |
states: { | |
idle:{ | |
on: { | |
CLICK_RIGHT: { | |
target: 'nextSlide' | |
}, |
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 allData = new Array(25).fill(0).map((_val, i) => i + 1); | |
const perPage = 10; | |
const dataMachine = new Machine({ | |
id: 'dataMachine', | |
initial: 'loading', | |
context: { | |
data: [], | |
}, |
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 jsdom = require('jsdom'); | |
const { | |
JSDOM | |
} = jsdom; | |
const Nightmare = require('nightmare'); | |
const nightmare = Nightmare(); | |
const url = 'http://books.toscrape.com/'; | |
// Grabbing the homepage html |
NewerOlder