function counter(state = 0, action) { switch (action.type) { case 'DEPOSIT': return state + action.value case 'WITHDRAW': return state - action.value default: return state } }
Football. Cloud. Tech. Politics. Pictures. Principal Architect for Messaging/Eventing at Microsoft. Today has been a lively day in some parts of the Twitterverse debating the Saga pattern. As it stands, there are a few frameworks for .NET out there that use the term "Saga" for some framework implementation of a state machine or workflow. Trouble is, that's not what a Saga is. A Saga is a failure m
Redux is a Flux-like framework that has exploded in popularity within the React community. It reduces complexity by enforcing a unidirectional data flow, the use of single state atom, and pure reduce functions for state updates. For me, there has always been one thorn in the React+Flux setup, which is that more complicated processes involving coordination of action creators and side-effects are ha
Principal Engineer, type system nerd, Rust enthusiast, supporter of social justice, loving husband & father, avid comic & manga reader, 日本語を勉強してる。 Home About Me @BKonkle YouTube I’m a Software Architect with more than 15 years of experience creating high performance server and front-end applications targeting web and mobile platforms, & today I lead a team at Formidable Labs. Share In recent weeks
There is a lot of talk about the latest kid in redux town right now, redux-saga/redux-saga. It uses generator functions for listening to/dispatching actions. Before I wrap my head around it, I would like to know the pros/cons of using redux-saga instead of the approach below where I'm using redux-thunk with async/await. A component might look like this, dispatch actions like usual. import { login
In this article I share my confusion and findings about Saga pattern. I’m not an expert in Saga or any other mentioned concepts. Recently I’ve been looking into a popular JavaScript library for handling complex asynchronous data flows in React.js applications built with Redux state management library which is called redux-saga. The way it works is very much similar to CSP (Communicating Sequential
redux-thunk と redux-saga の違いについて @kuy に聞いた。 きっかけはこの Tweet だ。この Tweet からの会話で聞いている。 redux-thunkは使わない方がいい。あれはやばい。 — Yuki Kodama (@kuy) 2016年5月7日 ぼくの両者の事前知識・経験としては、redux-thunk はすこし使った程度で、redux-saga は README を眺めた程度だ。どちらも非同期処理を含む副作用を処理できる redux の middleware という理解だ。ちなみに redux もすこし使った程度でしかなく、middleware をつくったことはない。 redux-thunk は Action Creator への引数をくるんだ closure "thunk" を redux で処理できるようにする middleware だ。 thu
Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? はじめに ReduxはSingle Store、immutableなState、副作用のないReducerという3つの原則を掲げたFluxフレームワークです。しかし他のフレームワークと違って提供しているものは最小限で、とてもフルスタックとは言えない薄さです。そのためすべてにおいて定番と言える書き方が定まっているわけでもなく、どうしようか迷ってしまうことも少なくありません。その筆頭とも言えるのが 非同期処理 の扱いです。コミュニティでは今でもさまざまな方向に模索が続いていますが、よく使われているものだとredux-thunk、redux-
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く