How to use the single-spa.getMountedApps function in single-spa

To help you get started, we’ve selected a few single-spa examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CanopyTax / single-spa / spec / apps / unmount-rejects / unmount-rejects.spec.js View on Github external
.then(() => {
                // it shouldn't be mounted again
                expect(myApp.numMounts()).toEqual(1);
                expect(singleSpa.getMountedApps()).toEqual([]);
                expect(singleSpa.getAppStatus('./unmount-rejects.app.js')).toEqual('SKIP_BECAUSE_BROKEN');
              })
          })
github CanopyTax / single-spa / spec / apps / unmount-times-out-dies / unmount-times-out-dies.spec.js View on Github external
.then(() => {
            expect(myApp.numUnmounts()).toEqual(1);
            expect(singleSpa.getMountedApps()).toEqual([]);
            expect(singleSpa.getAppStatus('./unmount-times-out-dies.app.js')).toEqual('SKIP_BECAUSE_BROKEN');
          })
      });
github CanopyTax / single-spa / spec / apps / mount-times-out / mount-times-out.spec.js View on Github external
.then(() => {
        expect(myApp.bootstraps()).toEqual(1);
        expect(myApp.mounts()).toEqual(1);
        expect(singleSpa.getMountedApps()).toEqual(['./mount-times-out.app.js']);
        expect(singleSpa.getAppStatus('./mount-times-out.app.js')).toEqual('MOUNTED');
      })
  });
github umijs / qiankun / src / effects.ts View on Github external
() => {
      const mountedApps = getMountedApps();
      if (!mountedApps.length) {
        navigateToUrl(defaultAppLink);
      }
    },
    { once: true },
github pingcap / tidb-dashboard / ui / lib / utils / registry.ts View on Github external
getActiveApp() {
    const mountedApps = singleSpa.getMountedApps()
    for (let i = 0; i < mountedApps.length; i++) {
      const app = mountedApps[i]
      if (this.apps[app] !== undefined) {
        return this.apps[app]
      }
    }
  }
}
github CanopyTax / single-spa / spec / apps / bootstrap-times-out / bootstrap-times-out.spec.js View on Github external
.then(() => {
        expect(myApp.wasBootstrapped()).toEqual(true);
        expect(myApp.wasMounted()).toEqual(true);
        expect(singleSpa.getMountedApps()).toEqual(['./bootstrap-times-out.app.js']);
        expect(singleSpa.getAppStatus('./bootstrap-times-out.app.js')).toEqual(singleSpa.MOUNTED);
        expect(errs.length).toBe(0);
      })
  });
github CanopyTax / single-spa / spec / apps / bootstrap-times-out-dies / bootstrap-times-out-dies.spec.js View on Github external
.then(() => {
        expect(myApp.wasBootstrapped()).toEqual(true);
        expect(myApp.wasMounted()).toEqual(false);
        expect(singleSpa.getMountedApps()).toEqual([]);
        expect(singleSpa.getAppStatus('./bootstrap-times-out-dies.app.js')).toEqual('SKIP_BECAUSE_BROKEN');
        expect(errs.length).toBeGreaterThan(0);
      })
  });
github CanopyTax / single-spa / spec / apps / returns-non-native-promise / returns-non-native-promise.spec.js View on Github external
.then(() => {
        expect(myApp.wasBootstrapped()).toEqual(true);
        expect(myApp.wasMounted()).toEqual(true);
        expect(singleSpa.getMountedApps()).toEqual(['./returns-non-native-promise.app.js']);

        location.hash = '#something-else';

        return singleSpa
          .triggerAppChange()
          .then(() => {
            expect(myApp.wasBootstrapped()).toEqual(true);
            expect(myApp.wasUnmounted()).toEqual(true);
            expect(singleSpa.getMountedApps()).toEqual([]);
          })
      })
  })
github CanopyTax / single-spa / spec / apps / register-with-object / register-with-object.spec.js View on Github external
.then(() => {
            expect(bootstrapped).toEqual(true);
            expect(mounted).toEqual(false);
            expect(singleSpa.getMountedApps()).toEqual([]);
          })
      })
github CanopyTax / single-spa / spec / apps / invalid-no-mount / invalid-no-mount.spec.js View on Github external
.then(() => {
        expect(myApp.isBootstrapped()).toEqual(false);
        expect(singleSpa.getMountedApps()).toEqual([]);
        expect(singleSpa.getAppStatus('./invalid-no-mount.app.js')).toEqual('SKIP_BECAUSE_BROKEN');
      })
  });