Closed cannorin closed 2 years ago
Related: #160
This PR makes @js.scope accept a tuple payload, which can be used to write a nested scope.
@js.scope
The example from #160 now can be written as:
module PlacesService: sig type t val new_places_service: Map.t -> t [@@js.new] ... end [@js.scope ("google", "maps", "places")]
Custom global object is also supported: assume fs: require('fs'), then we can now write
fs: require('fs')
[@@@js.scope (Imports.fs, "promises")]
This feature is not completely discoverable :-) Is there a natural place in the doc where it could be mentioned?
Fair enough, I opened https://github.com/LexiFi/gen_js_api/pull/169
Related: #160
This PR makes
@js.scope
accept a tuple payload, which can be used to write a nested scope.The example from #160 now can be written as:
Custom global object is also supported: assume
fs: require('fs')
, then we can now write