Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Output function name based on constant string

$
0
0

That’ll depend somewhat on firebase. One possibility would be to try a default export, since that’s what cjs modules are interpreted as in esm. In other words, replace

type module_ = {
  mutable exports: Js.Dict.t<Firebase.apiCallback>
}

external module_: module_ = "module"

module_.exports = Js.Dict.fromArray([
  (ApiDefinition.myAction, ApiImpl.myAction),
  (ApiDefinition.myOtherAction, ApiImpl.myOtherAction),
])

with

let default = Js.Dict.fromArray([
  (ApiDefinition.myAction, ApiImpl.myAction),
  (ApiDefinition.myOtherAction, ApiImpl.myOtherAction),
])

and see if firebase can still interpret what you’re doing.


Viewing all articles
Browse latest Browse all 2592

Trending Articles