js-api-loader icon indicating copy to clipboard operation
js-api-loader copied to clipboard

README not updated load() deprecated, importLibrary doesn't replace it 1-1

Open realgs opened this issue 11 months ago • 15 comments

Steps to reproduce

  1. Install js-api-loader 1.16.6, use steps from README to load google map script asynchronously - you get the IDE hint that load() is marked as deprecated, use importLibrary instead. ImportLibrary doesn't replace load(). Using load() everything works just fine but with the deprecation alert, using importLibrary it doesn't load maps.

Code example

            const loader = new Loader({
                libraries: ['places'],
                apiKey: this.apiKey,
            });
            loader.load().then((google) => {
                this.google = google;
                this.isLoading = false;
                this.isReady = true;
            });

I'd be happy to open a pull request to improve the project once you provide me with a solution. If load is deprecated what (and how) should be used instead?

realgs avatar Mar 01 '24 08:03 realgs