Skip to content

Commit 6b8b305

Browse files
committed
minor #2039 [Map] Change "BeforeConnect" for "BeforeCreate" in documentation (Kocal)
This PR was merged into the 2.x branch. Discussion ---------- [Map] Change "BeforeConnect" for "BeforeCreate" in documentation | Q | A | ------------- | --- | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT <!-- Replace this notice by a description of your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - For new features, provide some code snippets to help understand usage. - Features and deprecations must be submitted against branch main. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Technically the code is not wrong, but when listening for events `ux:map:marker:before-create` or `ux:map:info-window:before-create`, you can expect the method to be named `*BeforeCreate` and not `*BeforeConnect`. Commits ------- eceb244 [Map] Change "BeforeConnect" for "BeforeCreate" in documentation
2 parents 6918605 + eceb244 commit 6b8b305

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Map/doc/index.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,19 @@ Symfony UX Map allows you to extend its default behavior using a custom Stimulus
129129
connect() {
130130
this.element.addEventListener('ux:map:pre-connect', this._onPreConnect);
131131
this.element.addEventListener('ux:map:connect', this._onConnect);
132-
this.element.addEventListener('ux:map:marker:before-create', this._onMarkerBeforeConnect);
132+
this.element.addEventListener('ux:map:marker:before-create', this._onMarkerBeforeCreate);
133133
this.element.addEventListener('ux:map:marker:after-create', this._onMarkerAfterCreate);
134-
this.element.addEventListener('ux:map:info-window:before-create', this._onInfoWindowBeforeConnect);
134+
this.element.addEventListener('ux:map:info-window:before-create', this._onInfoWindowBeforeCreate);
135135
this.element.addEventListener('ux:map:info-window:after-create', this._onInfoWindowAfterCreate);
136136
}
137137
138138
disconnect() {
139139
// You should always remove listeners when the controller is disconnected to avoid side effects
140140
this.element.removeEventListener('ux:map:pre-connect', this._onPreConnect);
141141
this.element.removeEventListener('ux:map:connect', this._onConnect);
142-
this.element.removeEventListener('ux:map:marker:before-create', this._onMarkerBeforeConnect);
142+
this.element.removeEventListener('ux:map:marker:before-create', this._onMarkerBeforeCreate);
143143
this.element.removeEventListener('ux:map:marker:after-create', this._onMarkerAfterCreate);
144-
this.element.removeEventListener('ux:map:info-window:before-create', this._onInfoWindowBeforeConnect);
144+
this.element.removeEventListener('ux:map:info-window:before-create', this._onInfoWindowBeforeCreate);
145145
this.element.removeEventListener('ux:map:info-window:after-create', this._onInfoWindowAfterCreate);
146146
}
147147
@@ -159,7 +159,7 @@ Symfony UX Map allows you to extend its default behavior using a custom Stimulus
159159
console.log(event.detail.infoWindows);
160160
}
161161
162-
_onMarkerBeforeConnect(event) {
162+
_onMarkerBeforeCreate(event) {
163163
// The marker is not created yet
164164
// You can use this event to configure the marker before it is created
165165
console.log(event.detail.definition);
@@ -171,7 +171,7 @@ Symfony UX Map allows you to extend its default behavior using a custom Stimulus
171171
console.log(event.detail.marker);
172172
}
173173
174-
_onInfoWindowBeforeConnect(event) {
174+
_onInfoWindowBeforeCreate(event) {
175175
// The infoWindow is not created yet
176176
// You can use this event to configure the infoWindow before it is created
177177
console.log(event.detail.definition);

0 commit comments

Comments
 (0)