switchToApp
Change from one application to another.

Arguments

  1. 1.
    appName (string): Application name equivalent to the value specified in the application's package.json file.
  2. 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.

Returns

(Promise<void>): A promise that fulfills without arguments.

Example

1
import lampix from '@lampix/core';
2
3
lampix.switchToApp('trivia');
4
5
// or
6
7
lampix.switchToApp('trivia', {
8
switchBackTo: 'survey',
9
specialInformation: 42
10
});
11
12
// Query parameters can be easily accessed as follows:
13
// (also note the camelCase to kebab-case transformation)
14
// const queryParams = new URLSearchParams(window.location.search);
15
// queryParams.get('switch-back-to'); // survey
16
// queryParams.get('special-information') // '42'
Copied!

Notes

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 3yr ago