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
var ab = new ArrayBuffer(1); | |
worker.postMessage(ab, [ab]); | |
if (ab.byteLength) { | |
alert('Transferables are not supported in your browser!'); | |
} else { | |
// Transferables are supported. | |
} |
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
'addDocComments', | |
'annotator', | |
'babelrc', | |
'Bookmarks', | |
'bracket-pair-colorizer', | |
'code-navigation', | |
'code-settings-sync', | |
'color-highlight', | |
'copy-syntax', | |
'dark-plus-material', |
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
declare function flatten< | |
A, | |
B: $ReadOnlyArray<A> | A, | |
C: $ReadOnlyArray<B> | B, | |
D: $ReadOnlyArray<C> | C, | |
E: $ReadOnlyArray<D> | D, | |
>(xs: $ReadOnlyArray<E>): Array<A> | |
const listsList = [{ |
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 { stateShape } from '../store' | |
type ClientOrdersProps = { | |
orders: number[], | |
id: number, | |
} | |
const ClientOrders = ({ orders, id }: ClientOrdersProps) => | |
<div> | |
{orders.map( order => <div>{order}</div> )} |
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 | |
type Func</*::-*/I, /*::+*/O> = (x: I) => O | |
type Refiner<T, P/*::: $Pred<1>*/> = (val: mixed) => $Refine<T, P, 1> | |
function refineType<T, P/*::: $Pred<1>*/>(cb: P): Refiner<T, P> { | |
return function refiner(val: mixed): $Refine<T, P, 1> { | |
if (cb(val)) return val | |
throw new TypeError() | |
} |
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
/** | |
* Example with no .value in instances. Its can be much slower, | |
* but if you prefer pureness, that is your choice | |
*/ | |
export const just = data => new Just( data ) | |
export const of = just | |
export const nothing = () => new Nothing |
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 | |
declare export function curry3<A, B, C, D>(fn: (a: A, b: B, c: C) => D): ( | |
& ((a: A, nob: void, noc: void) => ( | |
& ((b: B, noc: void) => ((c: C) => D)) | |
& ((b: B, c: C) => D) | |
)) | |
& ((a: A, b: B, noc: void) => ((c: C) => D)) | |
& ((a: A, b: B, c: C) => D) | |
) |
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 | |
module.exports = { | |
"presets": [ | |
"@babel/preset-flow", | |
["@babel/preset-env", { | |
"targets": { | |
"node": "8.9" | |
}, | |
// "shippedProposals": true, |
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
declare global { | |
type $Shape<T> = T | |
type $Exact<T> = T | |
type $Spread<A, B> = A & B | |
type $ReadOnlyArray<T> = Array<T> | |
type $NonMaybeType<T> = T | |
type $Subtype<T> = T | |
type $Supertype<T> = T | |
type empty = never | |
type mixed = 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
//@flow | |
const { | |
readdirSync, | |
outputFileSync, | |
pathExistsSync, | |
//$todo | |
readFileSync, | |
} = require('fs-extra') |