(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
// funciona somente com v3.1.6, essa estrategia de end/continue | |
// era um backdoor para fazer recursao em types, recursao funcionava somente com interfaces | |
// antigamente pela resolucao de tipos ser lazyness e nao acabar fazendo o compiler cair | |
// potencialmente em um looping infinito na resolucao do tipo, por causa disto tem validacao | |
// no compiler agora e codigos nesse estilo sao barrados pelo compiler | |
type Init<T extends any[], TTail extends any[] = TailArray<T>> = CastArray<{ | |
[K in keyof TTail]: T[keyof T & K]; | |
}> |
https://twitter.com/snookca/status/1073299331262889984?s=21
Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows.
(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)
So the big deal about css-in-js (cij) is selectors.
// NOTE: code now moved to https://github.com/tycho01/typical | |
// older revision left here, but it no longer runs well in TS Playground | |
export type Obj<T> = { [k: string]: T }; | |
export type NumObj<T> = { [k: number]: T }; | |
// export type List = ArrayLike; // no unapplied generic types :( | |
export type List<T> = ArrayLike<T>; | |
// progress: https://github.com/Microsoft/TypeScript/issues/16392 | |
export function force<T, V extends T>() {} |
import * as React from 'react'; | |
import { observable } from 'mobx'; | |
import { observer } from 'mobx-react'; | |
import { DocumentModel } from '../models'; | |
import { Icon, Tooltip } from '../controls'; | |
@observer | |
export class Component extends React.Component<{ | |
record: DocumentModel, |
{ | |
"rules": { | |
"align": [ | |
true, | |
"parameters", | |
"arguments", | |
"statements" | |
], | |
"ban": false, | |
"class-name": true, |
https://github.com/piotrwitek/react-redux-typescript-guide#tslintjson
https://github.com/excelmicro/typescript
https://github.com/palantir/tslint-react
https://github.com/buzinas/tslint-eslint-rules