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 649B

12345678910111213141516171819202122
  1. // @flow
  2. import { ADD_KNOWN_DOMAINS } from './actionTypes';
  3. /**
  4. * Creates a (redux) action to add known domains to the list of domains known to
  5. * the feature base/known-domains.
  6. *
  7. * @param {string | Array<string>} knownDomains - The known domain(s) to add to
  8. * the list of domains known to the feature base/known-domains.
  9. * @returns {{
  10. * type: ADD_KNOWN_DOMAINS,
  11. * knownDomains: Array<string>
  12. * }}
  13. */
  14. export function addKnownDomains(knownDomains: string | Array<string>) {
  15. return {
  16. type: ADD_KNOWN_DOMAINS,
  17. knownDomains:
  18. typeof knownDomains === 'string' ? [ knownDomains ] : knownDomains
  19. };
  20. }