From 3c57b9adbf900fab9ebf84a717b8b13333cca22b Mon Sep 17 00:00:00 2001 From: epessina Date: Fri, 25 Oct 2024 17:53:55 +0200 Subject: [PATCH] Compose application options doc --- docs/docs/guides/applications/compose.md | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/docs/guides/applications/compose.md b/docs/docs/guides/applications/compose.md index 90285589..916866e0 100644 --- a/docs/docs/guides/applications/compose.md +++ b/docs/docs/guides/applications/compose.md @@ -25,6 +25,7 @@ interface ComposableApplication { integrationMode: "compose" config: PluginConfiguration | string // See explanation below route: string // Path on which the composable application will be rendered + options?: ComposableApplicationOptions // See explanation below } ``` @@ -464,3 +465,27 @@ layout: ```mdx-code-block ``` + +## Application options + +:::caution +Application options are available starting form version `2.4.2` and `@micro-lc/composer` version `2.2.0` +::: + +A set of options can be passed along in the application configuration through the `options` keyword. Options are an optional object with the following structure: + +```typescript +interface ComposableApplicationOptions { + fetchConfigOnMount?: boolean +} +``` + +### `fetchConfigOnMount` + +By default, retrieves compose applications configurations just once, at _bootstrap_ (i.e., the first time the user navigates to them). At any subsequent visit, configurations are retrieved from an in-memory cache during the _mount_ stage of the application lifecycle. + +If you need to re-fetch the configuration each time an application is visited, you can instruct to do so by setting the `fetchConfigOnMount` option to `true`. + +:::caution +This option will have effect only on applications that specify a **URL string** in the `config` key. +:::