Skip to content

feat(events): Add toggleAnnotationMode events#522

Merged
mergify[bot] merged 4 commits intobox:masterfrom
mickr:handle-toggle-annotation-mode
Jul 2, 2020
Merged

feat(events): Add toggleAnnotationMode events#522
mergify[bot] merged 4 commits intobox:masterfrom
mickr:handle-toggle-annotation-mode

Conversation

@mickr
Copy link
Collaborator

@mickr mickr commented Jun 19, 2020

  • Add middleware handler that will emit an annotations_mode_change when toggleAnnotationMode is dispatched.

@mickr mickr requested a review from a team as a code owner June 19, 2020 01:38
mickr and others added 4 commits July 1, 2020 21:56
* Add middleware handler that will emit an `annotations_mode_change` when toggleAnnotationMode is dispatched.
* Add object around emitted nextState item
@mickr mickr force-pushed the handle-toggle-annotation-mode branch from 8e4cffa to 139cdb6 Compare July 2, 2020 01:57
import { Event } from '../../@types';

export const handleToggleAnnotationModeAction = (prevState: AppState, nextState: AppState): void => {
eventManager.emit(Event.ANNOTATIONS_MODE_CHANGE, { mode: nextState.common.mode });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use the existing selector getAnnotationMode?

@mergify mergify bot merged commit 732e35a into box:master Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants