Skip to content

Conversation

@bob-voorhoede
Copy link
Contributor

For performance reasons it is desirable to not have a gigantic reactive map object. when that's unnecessary.
By not declaring it in data initialization, but still tacking it on the this in the component, we can use it in JS and pass it along to child components, but without it being augmented by Vue's reactivity system.

Copy link
Collaborator

@SiggyF SiggyF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep map as a non reactive attribute. It is now set just before created by the data() function. In this new approach the map is set during mounted and not available earlier.

export default {
name: 'v-mapbox',
data () {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We removed this before, but this caused several issues. Please consult with Cindy. If you don't initialize it from the data section it should be set on the object.
You can try to set it as a "normal" property of the object. Then you can access it through $options, see [1]. We also tried this before but this also gave synchronisation issues.

[1] https://vuejs.org/v2/api/#vm-options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants