LoginSignup
1
0

More than 5 years have passed since last update.

Redux-Saga

Last updated at Posted at 2017-10-05
function* counterSaga() {
  while(1) {
    yield effects.take('INCREMENT_ASYNC')
    yield effects.call(delay, 1000)
    yield effects.put({type: 'INCREMENT'})
  }
}

take => ActionListener (イベントアクションの発行を待つ)

call => 非同期処理、WebAPIをコール。

put => ReducerAction。非同期処理のレスポンスを受けてstateを

run => Sagaを起動?=リスナーをセット?

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0