From 9c6dbcdcc4a169e1ebd36e651ce41717796159d5 Mon Sep 17 00:00:00 2001 From: Graham Fairweather Date: Mon, 26 Feb 2018 09:01:03 +0100 Subject: [PATCH] Common event name constants, used by $emit and $on - DRY --- src/utils/eventNames.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+), 0 deletions(-) create mode 100644 src/utils/eventNames.js diff --git a/src/utils/eventNames.js b/src/utils/eventNames.js new file mode 100644 index 0000000..d440b5f --- /dev/null +++ b/src/utils/eventNames.js @@ -0,0 +1,27 @@ +import { + APPEND, + CHANGE, + CLOSE, + DESTROY, + FORM, + ON, + POPPER, + QUERY, + REMOVE, + SELECT, + SELECTED, + UPDATE, +} from './constants'; +import { + kebabJoin, +} from './assist'; + +export const EVENT_APPEND = kebabJoin(APPEND); +export const EVENT_ON_CHANGE = kebabJoin(ON, CHANGE); +export const EVENT_ON_DESTROY_POPPER = kebabJoin(ON, DESTROY, POPPER); +export const EVENT_ON_FORM_CHANGE = kebabJoin(ON, FORM, CHANGE); +export const EVENT_ON_QUERY_CHANGE = kebabJoin(ON, QUERY, CHANGE); +export const EVENT_ON_SELECT_CLOSE = kebabJoin(ON, SELECT, CLOSE); +export const EVENT_ON_SELECT_SELECTED = kebabJoin(ON, SELECT, SELECTED); +export const EVENT_ON_UPDATE_POPPER = kebabJoin(ON, UPDATE, POPPER); +export const EVENT_REMOVE = kebabJoin(REMOVE); -- libgit2 0.21.4