Download spectrum/shared/db/queries/channel.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 496 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/db/queries/channel.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/shared/db/queries/channel.js
-
curl -L -o channel.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/db/queries/channel.js
496 Bytes
| // @flow | |
| import { createReadQuery, db } from 'shared/db'; | |
| import type { DBChannel } from 'shared/types'; | |
| export const getChannelById = createReadQuery((id: string) => ({ | |
| query: db.table('channels').get(id), | |
| tags: (channel: ?DBChannel) => (channel ? [channel.id] : []), | |
| })); | |
| export const getChannelsById = createReadQuery((ids: Array<string>) => ({ | |
| query: db.table('channels').getAll(...ids), | |
| tags: (channels: ?Array<DBChannel>) => | |
| channels ? channels.map(({ id }) => id) : [], | |
| })); | |