Comment on page
switchToApp
Change from one application to another.
- 1.
appName
(string): Application name equivalent to the value specified in the application'spackage.json
file. - 2.
queryParameters
(Object, Optional): Plain object with keys used query parameters with their respective values. Note that keys will be converted from camelCase to kebab-case.
(
Promise<void>
): A promise that fulfills without arguments.import lampix from '@lampix/core';
lampix.switchToApp('trivia');
// or
lampix.switchToApp('trivia', {
switchBackTo: 'survey',
specialInformation: 42
});
// Query parameters can be easily accessed as follows:
// (also note the camelCase to kebab-case transformation)
// const queryParams = new URLSearchParams(window.location.search);
// queryParams.get('switch-back-to'); // survey
// queryParams.get('special-information') // '42'
switchBackTo
is a special query parameter used in the exit()
method to determine whether to switch to the default app (currently app-switcher
) or the app specified as the value for this parameter.Last modified 5yr ago