question/bank/managecategories/amd/src/events.js

  1. // This file is part of Moodle - http://moodle.org/
  2. //
  3. // Moodle is free software: you can redistribute it and/or modify
  4. // it under the terms of the GNU General Public License as published by
  5. // the Free Software Foundation, either version 3 of the License, or
  6. // (at your option) any later version.
  7. //
  8. // Moodle is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. //
  13. // You should have received a copy of the GNU General Public License
  14. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
  15. import {dispatchEvent} from 'core/event_dispatcher';
  16. /**
  17. * Reactive events for qbank_managecategories
  18. *
  19. * @module qbank_managecategories/events
  20. *
  21. */
  22. export const eventTypes = {
  23. /**
  24. * Event triggered when the activity reactive state is updated.
  25. *
  26. * @event qbankManagecategoriesStateUpdated
  27. * @type {CustomEvent}
  28. * @property {Array} nodes The list of parent nodes which were updated
  29. */
  30. qbankManagecategoriesStateUpdated: 'qbank_managecategories/stateUpdated',
  31. };
  32. /**
  33. * Trigger an event to indicate that the activity state is updated.
  34. *
  35. * @method notifyQbankManagecategoriesStateUpdated
  36. * @param {Object} detail the full state
  37. * @param {HTMLElement} container the custom event target (document if none provided)
  38. * @returns {CustomEvent}
  39. * @fires qbankManagecategoriesStateUpdated
  40. */
  41. export const notifyQbankManagecategoriesStateUpdated = (detail, container) => {
  42. return dispatchEvent(eventTypes.qbankManagecategoriesStateUpdated, detail, container);
  43. };