Created
September 7, 2016 09:40
-
-
Save zacck-zz/a02c081c549c1c9a8f3592cc900e4d64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export var startToggleTodo = (id, completed) => { | |
return (dispatch, getState) => { | |
/*access item we need to change*/ | |
var todoRef = firebaseRef.child(`todos/${id}`); | |
/*generate Updates*/ | |
var updates = { | |
completed, | |
completedAt: completed ? moment.unix() : null | |
}; | |
/*start updating*/ | |
todoRef.update(updates).then(() => { | |
dispatch(updateTodo(id, updates)); | |
}); | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
firebase.js?678b:426 Uncaught Error: Firebase.update failed: First argument contains NaN in property 'todos.-KQ_BiN5I0nel2NrBnxl.completedAt._i'22 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment