Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TargetState.name() returns string | StateDeclaration | State #3106

Closed
dsebastien opened this issue Oct 24, 2016 · 1 comment
Closed

TargetState.name() returns string | StateDeclaration | State #3106

dsebastien opened this issue Oct 24, 2016 · 1 comment
Milestone

Comments

@dsebastien
Copy link

Currently, calling .name() on a TargetState object returns either a string, a StateDeclaration or a State.
Is this by design? Shouldn't it just return the string?

IMO:

  • even if the target state does not exist (e.g., as could happen in an onInvalid callback function?), I guess that we can still get the name of the state the user tried to reach
  • if API user wants to retrieve the State or StateDeclaration, then he should rather use a dedicated method (e.g., getState, getStateDeclaration)

In my case I just want to log the name of the invalid target state for debugging purposes..

@christopherthielen
Copy link
Contributor

agreed. The code itself can only return a string, unless somebody has done something really weird like asking for a $state.target(stateObject) for a stateObject that hasn't actually been registered.

@christopherthielen christopherthielen added this to the 1.0.0-final milestone Oct 25, 2016
@christopherthielen christopherthielen modified the milestones: 1.0.0-beta.4, 1.0.0-final Nov 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants