You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actions.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // @flow
  2. import {
  3. LAUNCH_NATIVE_INVITE,
  4. SEND_INVITE_SUCCESS,
  5. SEND_INVITE_FAILURE
  6. } from './actionTypes';
  7. /**
  8. * Launches the native invite dialog.
  9. *
  10. * @returns {{
  11. * type: LAUNCH_NATIVE_INVITE
  12. * }}
  13. */
  14. export function launchNativeInvite() {
  15. return {
  16. type: LAUNCH_NATIVE_INVITE
  17. };
  18. }
  19. /**
  20. * Indicates that all native invites were sent successfully.
  21. *
  22. * @param {string} inviteScope - Scope identifier for the invite success. This
  23. * is used to look up relevant information on the native side.
  24. * @returns {void}
  25. */
  26. export function sendInviteSuccess(inviteScope: string) {
  27. return {
  28. type: SEND_INVITE_SUCCESS,
  29. inviteScope
  30. };
  31. }
  32. /**
  33. * Indicates that some native invites failed to send successfully.
  34. *
  35. * @param {Array<*>} items - Invite items that failed to send.
  36. * @param {string} inviteScope - Scope identifier for the invite failure. This
  37. * is used to look up relevant information on the native side.
  38. * @returns {void}
  39. */
  40. export function sendInviteFailure(items: Array<*>, inviteScope: string) {
  41. return {
  42. type: SEND_INVITE_FAILURE,
  43. items,
  44. inviteScope
  45. };
  46. }