- insist - настаивать
- apart - кроме
- posess - обладать
- considerably - изрядно, конкретно
- disclose раскрыть (секрет)
- complain жаловаца
- urgent срочный
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
/* @flow */ | |
import React from 'react' | |
import { compose, defaultProps, withProps } from 'recompose' | |
import type { HOC } from 'recompose'; | |
// type of Enhanced component props | |
type EnhancedComponentProps = { | |
text?: string, | |
}; |
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
// change output type of withProps | |
// from `HOC<A & B, B>` to `HOC<{ ...$Exact<B>, ...A }, B>` | |
type EnhancedCompProps = { b: number } | |
const enhancer2: HOC<*, EnhancedCompProps> = compose( | |
withProps(({ b }) => ({ | |
b: `${b}`, | |
})), | |
withProps(({ b }) => ({ | |
// $ExpectError The operand of an arithmetic operation must be a number |
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
// no string get | |
const get = (fn, def) => { | |
try { | |
return fn(); | |
} catch (e) { | |
return def; | |
} | |
}; | |
// usage example |
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
// How to check array access | |
const arr = []; | |
const proxiedArr = new Proxy(arr, { | |
set(target, name, value) { | |
console.log(target, name, value); | |
// console.trace(); | |
target[name] = value; | |
return value; | |
}, |
Similar js toExponential
method, but returns result in power format, instead of Xe-1
it returns X⋅10⁻¹
Usage example:
console.log(toPower(3, 111)); // out 1.110⋅10²
console.log(toPower(3, 0.00000000000000123)); //out 1.230⋅10⁻¹⁵
NewerOlder