Skip to content

Instantly share code, notes, and snippets.

@mitsuruog
mitsuruog / index.md
Last active January 24, 2025 02:47
express実践入門

express実践入門


自己紹介

小川充

  • mitsuruog
@tejacques
tejacques / HOCBaseRender.tsx
Last active May 2, 2022 13:05
React Higher Order Components in TypeScript
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}/>;
}
}
@forabi
forabi / Webpack 2.0.7-beta vs Rollup
Last active August 20, 2024 13:14
Webpack 2 vs Rollup
❯ 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
@azu
azu / Reactコンポーネントの作成ステップ.md
Last active June 10, 2017 05:59
Reactコンポーネント作成のステップ

https://gist.github.com/azu/d5e92de127f76545ffc2 の続き

ディレクトリ構造

  • コンポーネント名のディレクトリを作成
  • index.js をおき、そこにコンポーネントを定義する

コンポーネントの分類(TODO: 気に入ってない)

@btroncone
btroncone / rxjs_operators_by_example.md
Last active March 9, 2026 12:54
RxJS 5 Operators By Example
// 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) {
@shuhei
shuhei / epic.js
Last active August 5, 2016 02:59
An idea of side-effect-free epic like redux-saga for redux-observable
// 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$
@y0za
y0za / preact-redux-build-size.md
Last active January 11, 2018 11:34
preact redux build size

.babelrc

{
  "presets": ["es2015", "stage-0"],
  "plugins": [
    ["transform-react-jsx", { "pragma": "h" }],
    "transform-runtime"
  ]
}
@voluntas
voluntas / react.rst
Last active May 25, 2022 11:57
React コトハジメ

React コトハジメ

日時:2017-01-02
作:@voluntas
バージョン:2.1.0
URL:https://voluntas.githu.io/

突っ込みは Twitter @voluntas まで。

@ryo33
ryo33 / saga-relay.js
Last active October 18, 2016 12:35
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({