Document that with
methods accept Temporal object instances
#713
Labels
documentation
Additions to documentation
with
methods accept Temporal object instances
#713
Because in #403 it was decided that fields shouldn't be enumerable, I assumed that code like the following was required to use
with
with Temporal object instances.This assumption was wrong, which seems obvious now. But it still took me a few weeks to realize that I can use this much easier and intuitive code:
In a quick look at the docs for
with
, I only saw example code with object literals, which made this trick harder to discover. I think I'd slotted these methods into a mental box that said "only accepts object literals". This is obviously wrong in retrospect but is a good example of how unintended messages in the docs can persist in novice developers' heads.IMHO, it's worth adding additional samples to documentation for
with
to illustrate that even though you can't spread a Temporal instance into an object, you can pass it intowith
of another compatible Temporal instance.The text was updated successfully, but these errors were encountered: