Skip to content

Add function to get token for instance #15

@olee

Description

@olee

In order to write dynamic code it would be very helpful to have some kind of utility function like injector.getToken(instance) which would return the token for the specified instance.
There exist workarounds by wrapping the injector in a helper class to keep track of tokens, but I think this would rather make sense to be integrated into this library.

As an example for a use case:
I intend to use the tokens as a replacement for route urls - so I match against tokens and not route strings.
But to check if some route (by token) is active right now, I would have to perform a check like routeToken == getToken(currentView).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions