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
/* | |
types: | |
simple - 2 persons | |
complex - 2 > persons | |
*/ | |
const main = { | |
messages: { | |
title: 'Messages', |
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
updated String file contents via ajax |
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
updated String file contents via ajax |
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
// @jsx el | |
// @jsxFrag 'Fragment' | |
import * as React from 'react' | |
import {catalogs} from './effects/fetch-data' | |
import {createStore, createEvent, createEffect, createApi} from 'effector' | |
import {useStore} from 'effector-react' | |
const root = document.getElementById('root') | |
function el(tag, props, ...children) { |
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
{ | |
"metadata": { | |
"kernel_info": { | |
"name": "effector-editor" | |
}, | |
"language_info": { | |
"name": "ECMAScript", | |
"version": "6", | |
"mimetype": "application/javascript", |
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
// example 1 | |
const p1 = new Promise(resolve => setTimeout(resolve, 300, 'first promise')) | |
const p2 = new Promise(resolve => setTimeout(resolve, 200, 'second promise')) | |
const p3 = new Promise(resolve => setTimeout(resolve, 700, 'third promise')) | |
const p4 = new Promise(resolve => setTimeout(resolve, 500, 'fourth promise')) | |
const p5 = new Promise(resolve => setTimeout(resolve, 900, 'fifth promise')) | |
function concurrentCall(arrQueries, limit) { | |
const sortRes = [] |
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
// index.js | |
const render = () => | |
ReactDOM.render( | |
<Provider store={store}> | |
<ConnectedRouter history={history}> | |
<App /> | |
</ConnectedRouter> | |
</Provider>, | |
root | |
) |
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 p1 = new Promise(resolve => setTimeout(resolve, 300, 'first promise')) | |
const p2 = new Promise(resolve => setTimeout(resolve, 200, 'second promise')) | |
const p3 = new Promise(resolve => setTimeout(resolve, 700, 'third promise')) | |
const p4 = new Promise(resolve => setTimeout(resolve, 500, 'fourth promise')) | |
const p5 = new Promise(resolve => setTimeout(resolve, 900, 'fifth promise')) | |
function concurrentCall(arrQueries, count) { | |
const sortRes = [] | |
return new Promise(resolve => { |
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
var weatherForecast = { | |
id: '', | |
country: '', | |
temperature: '' | |
} | |
var xhr = new XMLHttpRequest(); | |
function query(url) { | |
xhr.open('GET', url); |
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
async function updateUser(token) { | |
let cancelled = false; | |
// we don't reject, since we don't have access to | |
// the returned promise | |
// so we just don't call other functions, and reject | |
// in the end | |
token.cancel = () => { | |
cancelled = true; | |
}; |