@reduxjs/toolkit#createEntityAdapter TypeScript Examples

The following examples show how to use @reduxjs/toolkit#createEntityAdapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: actions.ts    From jellyfin-audio-player with MIT License 5 votes vote down vote up
downloadAdapter = createEntityAdapter<DownloadEntity>({
    selectId: (entity) => entity.id,
})
Example #2
Source File: actions.ts    From jellyfin-audio-player with MIT License 5 votes vote down vote up
albumAdapter = createEntityAdapter<Album>({
    selectId: album => album.Id,
    sortComparer: (a, b) => a.Name.localeCompare(b.Name),
})
Example #3
Source File: actions.ts    From jellyfin-audio-player with MIT License 5 votes vote down vote up
trackAdapter = createEntityAdapter<AlbumTrack>({
    selectId: track => track.Id,
    sortComparer: (a, b) => a.IndexNumber - b.IndexNumber,
})
Example #4
Source File: actions.ts    From jellyfin-audio-player with MIT License 5 votes vote down vote up
playlistAdapter = createEntityAdapter<Playlist>({
    selectId: (playlist) => playlist.Id,
    sortComparer: (a, b) => a.Name.localeCompare(b.Name),
})
Example #5
Source File: ColumnSlice.tsx    From knboard with MIT License 5 votes vote down vote up
columnAdapter = createEntityAdapter<IColumn>({})
Example #6
Source File: CommentSlice.tsx    From knboard with MIT License 5 votes vote down vote up
commentAdapter = createEntityAdapter<TaskComment>({
  sortComparer: (a, b) => b.created.localeCompare(a.created),
})
Example #7
Source File: LabelSlice.tsx    From knboard with MIT License 5 votes vote down vote up
labelAdapter = createEntityAdapter<Label>({
  sortComparer: (a, b) => a.name.localeCompare(b.name),
})
Example #8
Source File: MemberSlice.tsx    From knboard with MIT License 5 votes vote down vote up
memberAdapter = createEntityAdapter<BoardMember>({
  sortComparer: (a, b) => a.username.localeCompare(b.username),
})