Writing component tests I discovered that all exposed instances, I mean mapInstance, markerInstance, etc, are always undefined.
This happens because the instance variable is undefined in the setup phase and it's only populated on the mounted hook.
To get the assigned instance later we need to use a computed to reevaluate which is the content of the variable when you call it. This looks redundant for the following reasons.
We exposed a promise in all components (in the next fix we'll add it to autocomplete too) and it returns undefined if the Google component is not created, or the created instance.
Also, a computed will be exposed and it will return undefined if the Google component is not created or the created instance.
For these reasons, we think a better option could be to remove the exposed instance and only expose the promise that resolves it.
Writing component tests I discovered that all exposed instances, I mean mapInstance, markerInstance, etc, are always undefined.
This happens because the instance variable is undefined in the setup phase and it's only populated on the mounted hook.
To get the assigned instance later we need to use a computed to reevaluate which is the content of the variable when you call it. This looks redundant for the following reasons.
We exposed a promise in all components (in the next fix we'll add it to autocomplete too) and it returns undefined if the Google component is not created, or the created instance. Also, a computed will be exposed and it will return undefined if the Google component is not created or the created instance. For these reasons, we think a better option could be to remove the exposed instance and only expose the promise that resolves it.