您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

actions.any.js 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // @flow
  2. import {
  3. REFRESH_CALENDAR,
  4. SET_CALENDAR_AUTHORIZATION,
  5. SET_CALENDAR_EVENTS
  6. } from './actionTypes';
  7. /**
  8. * Sends an action to refresh the entry list (fetches new data).
  9. *
  10. * @param {boolean} forcePermission - Whether to force to re-ask for
  11. * the permission or not.
  12. * @param {boolean} isInteractive - If true this refresh was caused by
  13. * direct user interaction, false otherwise.
  14. * @returns {{
  15. * type: REFRESH_CALENDAR,
  16. * forcePermission: boolean,
  17. * isInteractive: boolean
  18. * }}
  19. */
  20. export function refreshCalendar(
  21. forcePermission: boolean = false, isInteractive: boolean = true) {
  22. return {
  23. type: REFRESH_CALENDAR,
  24. forcePermission,
  25. isInteractive
  26. };
  27. }
  28. /**
  29. * Sends an action to signal that a calendar access has been requested. For more
  30. * info, see {@link SET_CALENDAR_AUTHORIZATION}.
  31. *
  32. * @param {string | undefined} authorization - The result of the last calendar
  33. * authorization request.
  34. * @returns {{
  35. * type: SET_CALENDAR_AUTHORIZATION,
  36. * authorization: ?string
  37. * }}
  38. */
  39. export function setCalendarAuthorization(authorization: ?string) {
  40. return {
  41. type: SET_CALENDAR_AUTHORIZATION,
  42. authorization
  43. };
  44. }
  45. /**
  46. * Sends an action to update the current calendar list in redux.
  47. *
  48. * @param {Array<Object>} events - The new list.
  49. * @returns {{
  50. * type: SET_CALENDAR_EVENTS,
  51. * events: Array<Object>
  52. * }}
  53. */
  54. export function setCalendarEvents(events: Array<Object>) {
  55. return {
  56. type: SET_CALENDAR_EVENTS,
  57. events
  58. };
  59. }