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 machine = Machine({ | |
id: 'prefetchWebView', | |
initial: 'idle', | |
context: { | |
}, | |
states: { | |
idle: { | |
on: { | |
RERENDER: 'isFileExists', | |
} |
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
// Tallio saved post library | |
function toggle(action) { | |
return assign({ | |
posts: (context) => { | |
let index = context.posts.findIndex((post) => post.id === '1'); | |
let updatedPost = { | |
...context.posts[index], | |
saved: action === 'save', | |
}; |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
version: 2.1 | |
jobs: | |
mirror: | |
docker: | |
- image: circleci/node:lts | |
steps: | |
- checkout |
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
version: 2.1 | |
jobs: | |
mirror: | |
docker: | |
- image: circleci/node:lts | |
steps: | |
- add_ssh_keys: | |
fingerprints: |
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
export default class MockStorage { | |
constructor(cache = {}) { | |
this.storageCache = cache; | |
} | |
setItem = jest.fn((key, value) => { | |
return new Promise((resolve, reject) => { | |
return typeof key !== 'string' || typeof value !== 'string' | |
? reject(new Error('key and value must be string')) | |
: resolve((this.storageCache[key] = 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
// @flow | |
// import fetch from 'node-fetch'; | |
async function fetchUsers(userNames: Array<string>): Promise<*> { | |
console.log('Start fetching'); | |
console.log('--------------'); | |
for (let userName of userNames) { | |
let orgs: Array<Object> = await fetch(`https://api.github.com/users/${userName}/orgs`).then((res: Response) => res.json()); // eslint-disable-line | |
console.log('Fetching user..'); |
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
// @flow | |
function combinedStyles(defaultStyle: Object, newStyle: ?Object) { | |
if (newStyle) { | |
return {...defaultStyle, ...newStyle}; | |
} | |
return defaultStyle; | |
} | |
export default combinedStyles; |