Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Investigate converting constant dicts to enums #255

Open
kevinbarabash opened this issue Mar 8, 2021 · 0 comments
Open

Investigate converting constant dicts to enums #255

kevinbarabash opened this issue Mar 8, 2021 · 0 comments
Labels
conversion enhancement New feature or request

Comments

@kevinbarabash
Copy link
Contributor

e.g.

export const action = {
    FETCH_PERMISSIONS: ("FETCH_PERMISSIONS": "FETCH_PERMISSIONS"),
    RECEIVED_PERMISSIONS: ("RECEIVED_PERMISSIONS": "RECEIVED_PERMISSIONS"),

    FETCH_ROLES: ("FETCH_ROLES": "FETCH_ROLES"),
    RECEIVED_ROLES: ("RECEIVED_ROLES": "RECEIVED_ROLES"),

    ...
};

could be converted to

export enum action {
    FETCH_PERMISSIONS = "FETCH_PERMISSIONS",
    RECEIVED_PERMISSIONS = "RECEIVED_PERMISSIONS",
    FETCH_ROLES = "FETCH_ROLES",
    RECEIVED_ROLES = "RECEIVED_ROLES",
    ...
}

This feels more idiomatic than what was suggested in #254.

@kevinbarabash kevinbarabash added enhancement New feature or request conversion labels Mar 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
conversion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant