Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
642 Bytes
import { createSelector } from 'reselect'
interface Todo {
id: number
completed: boolean
}
interface Alert {
id: number
read: boolean
}
export interface RootState {
todos: Todo[]
alerts: Alert[]
}
export const createAppSelector = createSelector.withTypes<RootState>()
const selectTodoIds = createAppSelector(
// Type of `state` is set to `RootState`, no need to manually set the type
state => state.todos,
// ❌ Known limitation: Parameter types are not inferred in this scenario
// so you will have to manually annotate them.
// highlight-start
(todos: Todo[]) => todos.map(({ id }) => id)
// highlight-end
)