From 869730534d420a8c789318e880b90a7a23464a19 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Wed, 12 Jul 2017 08:39:13 +1200 Subject: [PATCH] Added example of promise constructor. --- docs/HOME.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/HOME.md b/docs/HOME.md index 3a4c147f52..e2cceeb940 100644 --- a/docs/HOME.md +++ b/docs/HOME.md @@ -58,6 +58,12 @@ NOTE: Promises are only available if you supply a constructor to the [`createClient()`](module-@google_maps.html#.createClient) method. You must also chain `.asPromise()` to a method before any `.then()` or `.catch()` methods. For example: ```js +// Create client with a Promise constructor +const googleMapsClient = require('@google/maps').createClient({ + key: 'your API key here', + Promise: Promise // 'Promise' is the native constructor. +}); + // Geocode an address with a promise googleMapsClient.geocode({address: '1600 Amphitheatre Parkway, Mountain View, CA'}).asPromise() .then((response) => {