react-hexgrid
react-hexgrid copied to clipboard
toString functions on models
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?
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} }` );
}
@IcculusC can you link the blogpost?