Разберем как сделать асинхронный запрос в апи для получения курса валюты. На react c useEffect это выглядит так:
import { useEffect, useState } from 'react';
Rollup Plugin Name: commonjs Rollup Plugin Version: 13.0.0
Данный плагин (и Rollup in расширениях) работает настолько seamlessly насколько это возможно как с тем кодом который он генерирует сам, так и другими инструментами в экосистеме.
Есть большое количество интеграционных вопросов, о чем написано ниже.
npm install ts-graphql-plugin -D
.graphqlconfig
with folowing content (values for example):schemaPath: schema/schema.graphql
includes: ["components/**/*.{graphql,ts,tsx}"]
extensions:
endpoints:
default: http://localhost:4000
/** | |
* @param {Object} child | |
* @param {string} child.name | |
* @returns {boolean} | |
*/ | |
class MutePlugin { | |
constructor(pluginNameSubstring) { | |
this.pluginNameSubstring = pluginNameSubstring; | |
} |
function debugLogChanges() { | |
let lastDeps = []; | |
return deps => { | |
deps.forEach((d, i) => { | |
if (!Object.is(lastDeps[i], d)) { | |
console.log(`Change in [${i}]:`, lastDeps[i], '->', d); | |
} | |
}); | |
lastDeps = deps; | |
return deps; |
Известно что самая медленная операция в барузере - изменение DOM дерева. И что реакт стремится светси эти обновления к минимуму. Для этого он:
const { mv, ls, mkdir, isFolder } = require('./utils') | |
class SortOutput { | |
distPath = null; | |
constructor(rules) { | |
this.rules = rules; | |
this.start = this._start.bind(this) | |
} |
/** | |
* bbox: [llX, llY, urX, urY] | |
* ┌──╗ - ur (2) | |
* ╚──┘ | |
* └ ll (1) | |
*/ | |
function bboxToPolygon(bbox) { | |
const [llX, llY, urX, urY] = bbox; | |
return { | |
"type": "Feature", |
import { Remarkable } from 'remarkable'; | |
const mdRenderer = new Remarkable(); | |
export function md(strings, ...keys) { | |
return mdRenderer.render(strings.reduce((result, str, i) => result += str + ( | |
keys[i] === undefined | |
? '' | |
: keys[i]) | |
, '')); | |
} |