maps icon indicating copy to clipboard operation
maps copied to clipboard

Should setAccessToken return a Promise

Open YousefED opened this issue 3 years ago • 1 comments

For this library to work well, the consumer is expected to call setAccessToken to initialize it (even when not using Mapbox, no call to setAccessToken breaks).

The current implementation (java: https://github.com/rnmapbox/maps/blob/98c8f50a18c7b4f0b1ff0ee1606e4cc53b63a888/android/rctmgl/src/main/java-mapboxgl/common/com/mapbox/rctmgl/modules/RCTMGLModule.java#L302) returns before the new accesstoken is applied. This can cause issues since for example calling "getPacks" immediately after setAccessToken could fail.

A solution might be to make setAccessToken only resolve after it has been applied.

YousefED avatar Jun 28 '22 05:06 YousefED

@YousefED I think it's a good idea

mfazekas avatar Jun 28 '22 19:06 mfazekas