-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Description
-
During development of firebase functions, I want to use the emulator if I've spun it up locally, and I want to use the deployed version if it's not running. I create the
Functionsand associate with an emulator first and check a basic function call succeeds. If not, I make a new one, "without" an emulator. -
The SDK currently can't tell the difference between an instance with an emulator and without, and when "allocating" a new
Functionsit just does an app/region match, so returns the previousFunctionswith the emulator still associated.
I cannot remove the old emulator association (to reverseuseEmulator())
I cannot remove the old instance to create a clean one. -
a) Provide emulator params when construction functions, and make this a core part of distinguishing between different
Functionsinstances.
b) Allow me to destroy myFunctionsinstance once I'm done with it (seems like a sensible thing to add anyway :)
c) Allow me to remove the emulator association on an existing instance (hacky!)
API Proposal
class Functions ....
{
@objc open func removeEmulator() {
emulatorOrigin = nil
}
}
Firebase Product(s)
Functions