Get your SECRET from /profile/api
.
PUT /api/users/USER_ID
Section "InputClass" | |
Identifier "Ryo33 HHKB" | |
MatchProduct "Topre Corporation HHKB Professional" | |
Option "XkbModel" "pc104" | |
Option "XkbLayout" "us" | |
EndSection |
def register_handler(register_func, hander_func) do | |
spawn_link fn -> | |
register_func.() | |
for :ok <- Stream.cycle([:ok]) do | |
receive do | |
message -> handler_func.(message) | |
end | |
end | |
end | |
end |
これはredux-middlewaresの紹介です。
Middlewareがどのようなものかついては、非常に分かりやすい記事があるのでそれを貼っておきます。
http://qiita.com/kuy/items/57c6007f3b8a9b267a8e
僕がMiddlewareを活用するようになったのは、この記事を読んでからです。
These examples are not completely compatible about whether to call next(action)
.
function incrementAsync() {
import { create as createJsondiffpatch } from 'jsondiffpatch' | |
import clone from 'clone' | |
const jsondiffpatch = createJsondiffpatch({}) | |
function reducer(state = {}, action) { | |
switch (action.type) { | |
case 'INITIAL_STATE': | |
const initialState = action.payload | |
return initialState |
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({ |
function* before() { | |
yield fork(function*() { | |
yield* takeEvery('FETCH_USERS', fetchUsers) | |
}) | |
yield fork(function*() { | |
yield* takeEvery('CREATE_USER', createUser) | |
}) | |
} | |
function* after() { | |
yield fork(takeEvery, 'FETCH_USERS', fetchUsers) |
import throttle from 'react-throttle-render'; | |
const wrappedComponent = throttle(component, 50); |