Open-EO / openeo-web-editor

An interactive and easy to use web-based editor for the OpenEO API.
https://editor.openeo.org
Apache License 2.0
12 stars 17 forks source link

Refactor this.emit and this.$emit #200

Closed christophfriedrich closed 1 year ago

christophfriedrich commented 3 years ago

The this scope contains two event emitters: emit and $emit. They're not the same:

emit is the EventBusMixin emitter (i.e. send to root) and $emit is the local component emitter.

(@m-mohr in https://github.com/Open-EO/openeo-web-editor/commit/05916b5758d01aceb21cc7974bb8e3412cddf4e7#r55887565)

This is confusing if you're not aware of that, especially in circumstances like this:

https://github.com/Open-EO/openeo-web-editor/blob/05916b5758d01aceb21cc7974bb8e3412cddf4e7/src/components/FullscreenButton.vue#L82-L83

(At first sight I thought one of them was a typo)

Therefore this should be refactored at some point.

m-mohr commented 1 year ago

this.emit is now this.broadcast