For convenience and example for whoever might be wondering about TypeScript and React.
Because SFC<Props>
is much more readable in a chunk of code than React.SFC<Props>
const $ = require('sanctuary-def'); | |
const Ratio = | |
$.NullaryType('package-name/Ratio', | |
'https://package.url.io/Ratio', | |
x => typeof x === 'number' && (x >= 0 && x <= 1)); | |
// | |
const def = $.create({ |
[*.js] | |
indent_size = 2 | |
indent_style = space | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
export declare type Lens = string | number; | |
export declare type Optic = Lens | Array<Lens>; | |
export type Pred<T> = (x: T) => boolean; | |
export type GetValueFn<T = any, U = T> = (maybeData: T, index: number) => U; | |
export type SetValueFn<T1 = any, T2 = T1, U = T2> = (maybeValue: T1, maybeData: T2, index: number) => U; | |
export type ModifyFn<T = any, U = T> = (maybeData: T, i?: number) => U; |
Services* | |
Init* | |
init -> Get Results | |
Get Results | |
success -> Show Results | |
failed -> Show Error | |
Show Results | |
const { Suite } = require('benchmark'); | |
const R = require('ramda'); | |
const util = require('util'); | |
const suite = new Suite(); | |
const colors = `be4a2f | |
d77643 | |
ead4aa | |
e4a672 |
Notification | |
Idle | |
show -> Show | |
Show | |
delay ms -> Close | |
Close | |
completed -> Reset |
API call Promise | |
Pending | |
on data -> Fulfilled | |
on error -> Rejected | |
canceled -> Rejected | |
Fulfilled | |
done -> Finally | |
Rejected | |
done -> Finally | |
Finally |