Closed qwelias closed 2 years ago
ok, because I've seen this only now, I might land the change with README update and everything but I'd like to brainstorm a bit here ... wouldn't be better if toJSON()
returns {value: this.value}
instead? That looks like a more explicit representation about the fact the value was a signal to me, but maybe others already do the normal toJSON dance and that's just the value indeed? 🤔
@qwelias uhm ... actually that's not symmetric on parse(stringify(signal))
so maybe mine is not a good idea ... thoughts?
I've went ahead and added toJSON s you suggested, it's published now.
Same reasoning as for
valueOf
, not sure how to update README tho