Add pause feature

This commit is contained in:
Thomas Nordquist
2019-04-03 17:57:19 +02:00
parent 8266a87417
commit 094d795b39
6 changed files with 191 additions and 8 deletions

View File

@@ -57,3 +57,13 @@ export const showTree = (tree?: q.Tree<TopicViewModel>) => (dispatch: Dispatch<a
type: ActionTypes.TREE_SHOW_TREE,
})
}
export const togglePause = (tree?: q.Tree<TopicViewModel>) => (dispatch: Dispatch<any>, getState: () => AppState): AnyAction => {
const paused = getState().tree.paused
const tree = getState().tree.tree
// tree && tree.applyUnmergedChanges()
return dispatch({
type: paused ? ActionTypes.TREE_RESUME_UPDATES : ActionTypes.TREE_PAUSE_UPDATES,
})
}