Azure / AppConfiguration-JavaScriptProvider

The configuration provider for consuming data in Azure App Configuration from JavaScript applications like Node or browser apps.
https://github.com/Azure/AppConfiguration
MIT License
6 stars 1 forks source link

Watched Settings Description #63

Closed PrestonGiorgianni closed 2 months ago

PrestonGiorgianni commented 2 months ago

Based on the description of this setting, I was expecting the package to watch for changes.

Screenshot 2024-05-14 at 2 17 22 PM

When I was writing code, it seems I have to call refresh on a regular basis to check for any changes.

Is this the expected behavior?

Eskibear commented 2 months ago

yes, it's the expected behavior. You can decide when to call refresh() on your own. Taking a web app for example, it's recommended to be event-driven, calling refresh() when a request comes in, which would save quota. Of course you can also simply polling changes by calling refresh() with a fixed interval... It's totally up to you.

Eskibear commented 2 months ago

Maybe change the description as below, does it look clearer?

Any modification to watched settings will refresh all setting loaded by the configuration provider when refresh() is called.

PrestonGiorgianni commented 2 months ago

That would make it very clear what this setting does. I love the idea

Eskibear commented 2 months ago

@PrestonGiorgianni We recently updated the docs for dynamic configuration, hope it helps as well. https://learn.microsoft.com/en-us/azure/azure-app-configuration/enable-dynamic-configuration-javascript?tabs=configuration-map

PrestonGiorgianni commented 2 months ago

@Eskibear Thank you