Skip to content

Commit

Permalink
CHANGELOG: clarify "Migrate from callbacks to async-await"
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 committed Dec 21, 2024
1 parent 756dc27 commit 6e869c8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@
- tests: Migrate unit tests to Vitest ([d997740](https://github.com/perliedman/leaflet-control-geocoder/commit/d997740))
- fix: bingMaps uri (#342) ([be056ab](https://github.com/perliedman/leaflet-control-geocoder/commit/be056ab)), closes [#342](https://github.com/perliedman/leaflet-control-geocoder/issues/342)

```diff
Migrate from callbacks to Promise

-geocoder.geocode(query, callback);
+geocoder.geocode(query).then(callback);

-geocoder.reverse(latlng, scale, callback);
+geocoder.reverse(latlng, scale).then(callback);

Migrate from callbacks to async-await

-geocoder.geocode(query, callback);
+const results = await geocoder.geocode(query);

-geocoder.reverse(latlng, scale, callback);
+const results = await geocoder.reverse(latlng, scale);
```

## 2.4.0 (2022-02-06)

- export { Geocoder, geocoder, geocoders } ([ec17333](https://github.com/perliedman/leaflet-control-geocoder/commit/ec17333))
Expand Down

0 comments on commit 6e869c8

Please sign in to comment.