Skip to content
Alexis Brodeur edited this page Mar 15, 2018 · 1 revision

In a Duck

import { createHelpers } from 'redux-entities'

export type User =
  { id: string
  , email: string
  , firstName: string
  , lastName: string
  , avatarUrl: string
  , token: string
  }

export const {
  actions: {
    setEntities: setUsers
    setEntity: setUser,
    unsetEntities: unsetUsers,
    unsetEntity: unsetUser
  },
  selectors: {
    getEntities: getUsers,
    getEntities: getUsersSafe,
    getEntity: getUser,
    hasEntity: hasUser
  }
} = createHelpers<User>('user')
Clone this wiki locally