[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.

34 lines
772 B

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. import { Action } from 'redux'
  2. import { Entity, EntityStore, EntityType } from '../types'
  3. export interface SetEntityAction extends Action {
  4. type: 'ENTITIES_SET_ENTITY'
  5. payload: {
  6. type: string
  7. entity: Entity
  8. }
  9. }
  10. export interface SetEntitiesAction extends Action {
  11. type: 'ENTITIES_SET_ENTITIES'
  12. payload: {
  13. entities: EntityStore
  14. }
  15. }
  16. export type EntitiesActions = SetEntityAction | SetEntitiesAction
  17. export const setEntity = (type: EntityType, entity: Entity): SetEntityAction => ({
  18. type: 'ENTITIES_SET_ENTITY',
  19. payload: {
  20. type,
  21. entity,
  22. }
  23. })
  24. export const setEntities = (entities: EntityStore): SetEntitiesAction => ({
  25. type: 'ENTITIES_SET_ENTITIES',
  26. payload: {
  27. entities,
  28. }
  29. })