- mitsuruog
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 * as React from 'react'; | |
| import { Component } from 'react'; | |
| export default function HOCBaseRender<Props, State, ComponentState>( | |
| Comp: new() => Component<Props & State, ComponentState>) { | |
| return class HOCBase extends Component<Props, State> { | |
| render() { | |
| return <Comp {...this.props} {...this.state}/>; | |
| } | |
| } |
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
| ❯ rollup --version | |
| rollup version 0.25.3 | |
| ❯ time rollup -c ./rollup.js | |
| rollup -c ./rollup.js 4.65s user 0.22s system 118% cpu 4.131 total | |
| ❯ time webpack | |
| Hash: ebb00bbccd954c114d3c | |
| Version: webpack 2.0.7-beta | |
| Time: 3623ms |
https://gist.github.com/azu/d5e92de127f76545ffc2 の続き
- コンポーネント名のディレクトリを作成
index.jsをおき、そこにコンポーネントを定義する
コンポーネントの分類(TODO: 気に入ってない)
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
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
| // Getter a :: () -> a | |
| // gmap :: ((a -> b), Getter a), Getter b | |
| function gmap(fn, getter) { | |
| return () => fn(getter()) | |
| } | |
| // gcombine2 :: ((a,b) -> c, Getter a, Getter ab) -> Getter c | |
| function gcombine2(fn, getter1, getter2) { |
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
| // Explicit in-out of side-effect actions. | |
| function epic(action$, store) { | |
| const fooReq$ = action$.ofType('FOO') | |
| .map(action => call('FOO_REQ', webapi.getFoo, action.payload.id)); | |
| const foo$ = action$.ofType('FOO_REQ') | |
| .map(foo => ({ type: 'FOO_FETCHED', payload: { foo } })); | |
| return Observable.merge( | |
| fooReq$, | |
| foo$ |
| 日時: | 2017-01-02 |
|---|---|
| 作: | @voluntas |
| バージョン: | 2.1.0 |
| URL: | https://voluntas.githu.io/ |
突っ込みは Twitter @voluntas まで。
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
| function* relay(request, relayChannel, nextChannel) { | |
| const result = yield call(request) | |
| yield put(relayChannel, [result, nextChannel]) | |
| } | |
| function* runSequencially(requestChannel, resultChannel) { | |
| let head = channel() | |
| let tail = head | |
| while (true) { | |
| const { request, relayResult } = yield race({ |
