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

toString functions on models #23

Open
IcculusC opened this issue Oct 11, 2018 · 2 comments
Open

toString functions on models #23

IcculusC opened this issue Oct 11, 2018 · 2 comments

Comments

@IcculusC
Copy link

it would be extremely useful if the Hex model had a toString function, so that it can be used as the key in a hash map

the default behavior is [object Object], which makes it pretty useless, and a hash map is the recommended storage method on the red blob post!

thoughts?

@luisfrocha
Copy link
Contributor

Can you elaborate on this? Do you mean something like the following?

  toString(){
    return JSON.stringify( `{ q: ${ this.q }, r: ${ this.r }, s: ${this.s} }` );
  }

@jannikbuschke
Copy link
Collaborator

@IcculusC can you link the blogpost?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants