Omar Miatello
03/17/2018, 3:55 PMgildor
03/20/2018, 1:12 AMexternal val exports
, currently this is the only way, but if this change will be made in Kotlin Js you can define firebase functions just like top level val:
val myFunction = fireFunctions.https.onRequest{}
https://youtrack.jetbrains.com/issue/KT-19016#comment=27-2505111
There is my comment explains problem with top level val
Also instead of using external require, you can define it in more Kotlin-js way:
@file:JsModule("firebase-functions")
package functions
external val https: dynamic
So now you can just import required API of functions, without explicit import