摘要:
For example, current we have those todos:{ todos: [ { completed: true, id: 0, text: "Learn Redux"}, { completed: false, id: 1, text: "Go shoppi... 阅读全文
摘要:
Creating a Service:Before actual create an angular service, first create a constructor in Javascript: //constructor function function DroidServi... 阅读全文
摘要:
In the previous lesson we created a reducer that can handle two actions, adding a new to-do, and toggling an existing to-do. Right now, the code to up... 阅读全文
摘要:
Learn how to implement toggling a todo in a todo list application reducer.let todo = (state = [], action) => { switch(action.type){ case 'ADD_IT... 阅读全文
摘要:
Learn how to implement adding a todo in a todo list application reducer.let todo = (state = [], action) => { switch(action.type){ case 'ADD_ITEM... 阅读全文
摘要:
Take away:Always check you ruturn the accumulatorAlways pass in the inital valuevar data = ["vote1", "vote2", "vote1", "vote2"];var reducer = function... 阅读全文
摘要:
Sometimes we need to turn arrays into new values in ways that can't be done purely by passing an accumulator along with no knowledge about its context... 阅读全文
摘要:
Learn how to use Object.assign() and the spread operator proposed for ES7 to avoid mutating objects./* * Open the console to see * that the tests have... 阅读全文