# All files / composer/utils LifecycleHooks.js

14.29% Statements 1/7
0% Branches 0/1
0% Functions 0/4
14.29% Lines 1/7

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24

    7x

     import AppStore from '../stores/AppStore';
    import events from './Events';

    const AppHooks = {
      handleAppLoaded: () => {
        const { shouldDisplayHelpButton } = AppStore.getMetaData();
        const { isFreeUser } = AppStore.getUserData();

        events.emit('loaded', { isFreeUser, shouldDisplayHelpButton });
      },

      handleSavedDrafts: ({ message } = {}) => {
        events.emit('saved-drafts', { message });
      },

      handleBackdropClicked: () => {
        events.emit('backdrop-clicked');
      },

      closeComposer: () => events.emit('closed'),
    };

    export default AppHooks;