geocoder icon indicating copy to clipboard operation
geocoder copied to clipboard

Promisifying this module

Open dsernst opened this issue 10 years ago • 3 comments

SInce geocoder.geocode() takes a callback as its second to last argument, I found this module to be more difficult than usual to promisify using something like bluebird's promisifyAll() function.

Have you ever tried this? Do you have any tips?

dsernst avatar Jul 31 '15 05:07 dsernst

Imagine seeing you here @dsernst because I came for this reason.

jontewks avatar Oct 29 '15 19:10 jontewks

I've done it, just so I can use the .then instead of the callback signature. Performance seems to be the same. Here is a project I used it in https://github.com/troy0820/fixit/blob/master/request-promise.js

troy0820 avatar Nov 19 '15 02:11 troy0820

I've updated the code to now use promises. Refer #16 https://github.com/niftytushar/geocoder

niftytushar avatar Dec 31 '15 05:12 niftytushar