[ABANDONED] React/Redux front end for the Flexor social network.
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.

40 lines
896 B

5 years ago
5 years ago
  1. import { Action } from 'redux'
  2. import { EntityListKey } from '../types'
  3. export interface ListAppendAction extends Action {
  4. type: 'LISTS_APPEND'
  5. payload: {
  6. key: string
  7. entities: string[]
  8. continuation?: string
  9. }
  10. }
  11. export interface ListSetAction extends Action {
  12. type: 'LISTS_SET'
  13. payload: {
  14. key: string
  15. entities: string[]
  16. continuation?: string
  17. }
  18. }
  19. export type ListsActions = ListAppendAction | ListSetAction
  20. export const listAppend = (key: string, entities: string[], continuation?: string): ListAppendAction => ({
  21. type: 'LISTS_APPEND',
  22. payload: {
  23. key,
  24. entities,
  25. continuation,
  26. },
  27. })
  28. export const listSet = (key: string, entities: string[], continuation?: string): ListSetAction => ({
  29. type: 'LISTS_SET',
  30. payload: {
  31. key,
  32. entities,
  33. continuation,
  34. },
  35. })