Skip to content

Dictionary type - why is undefined a possible entity value #930

Closed

Description

export declare interface Dictionary<T> extends DictionaryNum<T> {
    [id: string]: T | undefined;
}

Getting the chance to use rtk for the first time, and using createEntityAdapter. Just coming across this and wondering why the possible value of an entity is undefined. The entity keys are created off the entity object so I can't imagine a scenario where it would be undefined. Not a big deal, but means accounting/coding for undefined every time you access an entity.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions