Repository navigation
Values should be the same data structure #690
Replies: 2 comments 1 reply
|
That depends on your implementation. I don't think that nesting the value will solve a problem here. Since My take is to use an abstraction over 3rd party lib and have a Although, it may be a good idea to take a closer look at class DetailedCellError {
constructor(public value) {}
toString(): string {
return this.value
}
valueOf(): string {
return this.value
}
[Symbol.toPrimitive](hint): string {
return this.value
}
}Result: const detailedCellError = new DetailedCellError('#REF!')
console.log(+detailedCellError) // "#REF!"
console.log(`${detailedCellError}`) // "#REF!"
console.log(detailedCellError + '') // "#REF!"Note: We need a feature check for |
|
Please note that HyperFormula feature requests have been moved to the Handsontable forums: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description
If you do
getCellValueon an invalid cell then it results in this:Whereas if you perform
getCellValueon a valid cell it produces a non object like this:22Instead of switching data types it's always better to keep consistent and produce the same data type in my opinion so that users don't have to do if statement checks (and also because it's just more developer friendly), in this case I think
getCellValueshould always return an object like so:Or if it's valid:
This means that we don't have to do weird checks like
!value.type && ...or something if we want to check that the cell has computed correctly.All reactions