GrainAnalytics instance. Every configuration value is a string. Read
Remote configuration for the cache-first model.
Every example below starts from this instance.
getConfig
defaultConfigurations, then undefined. It starts a background refresh.
getAllConfigs
defaultConfigurations,
without a request.
getConfigAsync
forceRefresh is not true, the promise resolves from the
cache. Otherwise the client calls the API.
getAllConfigsAsync
fetchConfig
null when the
request fails.
preloadConfig
preloadConfig at application start, before the first render. After it resolves,
getConfig returns the loaded values without a request.
addConfigChangeListener
fetchConfig or forceRefresh,
and after every other cache update.
removeConfigChangeListener
destroy too.