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 jsdom = require('jsdom'); | |
| const { | |
| JSDOM | |
| } = jsdom; | |
| const Nightmare = require('nightmare'); | |
| const nightmare = Nightmare(); | |
| const url = 'http://books.toscrape.com/'; | |
| // Grabbing the homepage html |
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 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 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 sliderMachine = new Machine({ | |
| id: 'sliderMachine', | |
| initial: 'idle', | |
| context: {}, | |
| states: { | |
| idle:{ | |
| on: { | |
| CLICK_RIGHT: { | |
| target: 'nextSlide' | |
| }, |
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 dataCollectionStates = { | |
| id: 'dataCollectionStates', | |
| initial: 'idle', | |
| states: { | |
| idle: { | |
| on: { | |
| CHANGE: { | |
| target: 'idle', | |
| actions: ['updateValue'], | |
| }, |
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
| Powered* | |
| powerFail -> Unpowered | |
| Green* | |
| tick -> Yellow | |
| Yellow | |
| tick -> Red | |
| Red | |
| tick -> Green | |
| Unpowered |
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
| import React, { ReactNode } from 'react'; | |
| type ButtonVariants = 'orange' | 'light'; | |
| interface ButtonProps { | |
| children: ReactNode; | |
| variant?: ButtonVariants; | |
| icon?: ReactNode; | |
| clickFn?: () => any; | |
| } |
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
| MWR_PANEL* | |
| IDLE* | |
| click -> FETCHING_DATA | |
| fetch -> FETCHING_DATA | |
| FETCHING_DATA | |
| success -> COMPONENT_HYDRATED | |
| fail -> ERROR | |
| ERROR | |
| retry -> FETCHING_DATA | |
| COMPONENT_HYDRATED |
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
| { | |
| "suggest.noselect": false, | |
| "coc.preferences.formatOnSaveFiletypes": [ | |
| "javascript", | |
| "typescript", | |
| "typescriptreact", | |
| "json", | |
| "javascriptreact", | |
| "typescript.tsx", | |
| "scss", |
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
| Main Navigation | |
| nav_closed* | |
| MOUSE_IN -> nav_open | |
| nav_open | |
| MOUSE_OUT -> nav_closed | |
| Panel_One& | |
| PANEL_CLICK -> panel_open | |
| panel_closed* | |
| panel_open | |
| PANEL_CLICK -> panel_closed |
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
| function createArrayGroups( | |
| data: any[], | |
| maxArrayLength: number | |
| ): (any | any[])[] { | |
| let array = [...data]; | |
| let groups: (any | any[])[] = []; | |
| do { | |
| groups.push(array.splice(0, maxArrayLength)); | |
| } while (array.length > 0); |
OlderNewer