Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // @flow
  2. import {
  3. INIT_SEARCH,
  4. INIT_UPDATE_STATS,
  5. UPDATE_STATS,
  6. INIT_REORDER_STATS
  7. } from './actionTypes';
  8. /**
  9. * Starts a search by criteria.
  10. *
  11. * @param {string | null} criteria - The search criteria.
  12. * @returns {Object}
  13. */
  14. export function initSearch(criteria: string | null) {
  15. return {
  16. type: INIT_SEARCH,
  17. criteria
  18. };
  19. }
  20. /**
  21. * Gets the new stats and triggers update.
  22. *
  23. * @param {Function} getSpeakerStats - Function to get the speaker stats.
  24. * @returns {Object}
  25. */
  26. export function initUpdateStats(getSpeakerStats: Function) {
  27. return {
  28. type: INIT_UPDATE_STATS,
  29. getSpeakerStats
  30. };
  31. }
  32. /**
  33. * Updates the stats with new stats.
  34. *
  35. * @param {Object} stats - The new stats.
  36. * @returns {Object}
  37. */
  38. export function updateStats(stats: Object) {
  39. return {
  40. type: UPDATE_STATS,
  41. stats
  42. };
  43. }
  44. /**
  45. * Initiates reordering of the stats.
  46. *
  47. * @returns {Object}
  48. */
  49. export function initReorderStats() {
  50. return {
  51. type: INIT_REORDER_STATS
  52. };
  53. }