Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const removeTodo = (todo: TodoImmutable) => {
- return (dispatch: Function) => {
- return getDB().then((db: PouchDB.Database) =>
- db.get(todo.get('_id')).then((doc) => {
- return db.remove(doc).then(response => {
- // On notifie le store Redux
- dispatch({
- type: Action.REMOVE_TODO,
- todo
- });
- });
- })
- );
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement