ui.js 657 B

12345678910111213141516171819202122232425262728293031323334353637
  1. +/* This Source Code Form is subject to the terms of the Mozilla Public
  2. + * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. "use strict";
  5. const {
  6. OPEN_SIDEBAR,
  7. TOGGLE_SIDEBAR,
  8. } = require("../constants");
  9. /**
  10. * Change sidebar open state.
  11. *
  12. * @param {boolean} open - open state
  13. */
  14. function openSidebar(open) {
  15. return {
  16. type: OPEN_SIDEBAR,
  17. open,
  18. };
  19. }
  20. /**
  21. * Toggle sidebar open state.
  22. */
  23. function toggleSidebar() {
  24. return {
  25. type: TOGGLE_SIDEBAR,
  26. };
  27. }
  28. module.exports = {
  29. openSidebar,
  30. toggleSidebar,
  31. };