Skip to content

Allow numbers as keys #227

Description

@aWeinzierl

As dictionaries with numbers are a lot faster, and I could not think of any advantages, I use numbers as keys.

However, entity-state seems to allow only strings as keys. For instance, EntitySelector<T> is restricted to string-types (except when you use a custom lambda).

/**
 * An EntitySelector determines which entities will be affected.
 * Can be one of the following:
 * - a single ID in form of a string
 * - multiple IDs in form of an array of strings
 * - a predicate function that returns `true` for entities to be selected
 */
export declare type EntitySelector<T> = string | string[] | ((entity: T) => boolean);

It would be great if the restrictions could be just a little bit relaxed by extending such types to numbers.

Metadata

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