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.ts 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import {
  2. INIT_REORDER_STATS,
  3. INIT_SEARCH,
  4. INIT_UPDATE_STATS,
  5. RESET_SEARCH_CRITERIA,
  6. TOGGLE_FACE_EXPRESSIONS,
  7. UPDATE_SORTED_SPEAKER_STATS_IDS,
  8. UPDATE_STATS
  9. } from './actionTypes';
  10. /**
  11. * Starts a search by criteria.
  12. *
  13. * @param {string | null} criteria - The search criteria.
  14. * @returns {Object}
  15. */
  16. export function initSearch(criteria: string | null) {
  17. return {
  18. type: INIT_SEARCH,
  19. criteria
  20. };
  21. }
  22. /**
  23. * Gets the new stats and triggers update.
  24. *
  25. * @param {Function} getSpeakerStats - Function to get the speaker stats.
  26. * @returns {Object}
  27. */
  28. export function initUpdateStats(getSpeakerStats: Function) {
  29. return {
  30. type: INIT_UPDATE_STATS,
  31. getSpeakerStats
  32. };
  33. }
  34. /**
  35. * Updates the stats with new stats.
  36. *
  37. * @param {Object} stats - The new stats.
  38. * @returns {Object}
  39. */
  40. export function updateStats(stats: Object) {
  41. return {
  42. type: UPDATE_STATS,
  43. stats
  44. };
  45. }
  46. /**
  47. * Updates the speaker stats order.
  48. *
  49. * @param {Object} participantIds - Participant ids.
  50. * @returns {Object}
  51. */
  52. export function updateSortedSpeakerStatsIds(participantIds?: Array<string>) {
  53. return {
  54. type: UPDATE_SORTED_SPEAKER_STATS_IDS,
  55. participantIds
  56. };
  57. }
  58. /**
  59. * Initiates reordering of the stats.
  60. *
  61. * @returns {Object}
  62. */
  63. export function initReorderStats() {
  64. return {
  65. type: INIT_REORDER_STATS
  66. };
  67. }
  68. /**
  69. * Resets the search criteria.
  70. *
  71. * @returns {Object}
  72. */
  73. export function resetSearchCriteria() {
  74. return {
  75. type: RESET_SEARCH_CRITERIA
  76. };
  77. }
  78. /**
  79. * Toggles the face expressions grid.
  80. *
  81. * @returns {Object}
  82. */
  83. export function toggleFaceExpressions() {
  84. return {
  85. type: TOGGLE_FACE_EXPRESSIONS
  86. };
  87. }