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 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 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 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 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 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 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 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 function deepSeq<P>( | |
...path: P | |
): $TupleMap<P, <T, Prop>(prop: Prop) => T => $ElementType<T, Prop>> | |
declare var pipe: $ComposeReverse | |
const target: 'target' = 'target' |
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
export function Do(generatorFunction) { | |
const generator = generatorFunction() | |
return function next(error, v) { | |
const res = generator.next(v) | |
if (res.done) | |
return res.value | |
else |
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
import {Stream, fromPromise} from 'most' | |
import {message, effect, Effect, Message} from 'effector' | |
type State = { | |
currentUser: number, | |
} | |
/** | |
* Plain async function | |
*/ |
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 | |
export type SeedValue<S, V> = { | |
seed: S, | |
value: V, | |
} | |
export type TimeValue<V> = { | |
/*::+*/time: number, | |
/*::+*/value: V | |
} |