Skip to content

Instantly share code, notes, and snippets.

@Calvin-Huang
Last active February 13, 2017 19:00
Show Gist options
  • Save Calvin-Huang/14fc843cd878dfadbe4f87f8bc8850ea to your computer and use it in GitHub Desktop.
Save Calvin-Huang/14fc843cd878dfadbe4f87f8bc8850ea to your computer and use it in GitHub Desktop.

About redux-saga

不論是 redux-thunk 或是 redux-saga,他們的基底都是 redux,所以就由 redux 的基礎開始看起。

接下來會以官方最簡單也最核心的 To-Do App demo 作為一步步推演、展示 redux 的核心

To-Do App in classic js implmented

在一個 To-Do App 裡面,我們可以設想到會有兩個物件在互相作動

// Model
const model = {
  todos: [{
    text: 'Eat food',
    completed: true
  }, {
    text: 'Exercise',
    completed: false
  }],
  visibilityFilter: 'SHOW_COMPLETED'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment