unmountHabitats()

in src/Bootstrapper.js [208:231]


	unmountHabitats(cb = null) {

		// Lifecycle event
		if (typeof this.willUnmountHabitats === 'function') {
			this.willUnmountHabitats();
		}

		// Get open habitats for this container
		const habitats = Habitat.listHabitats(this.__container__.id);

		// Clean up
		for (let i = 0; i < habitats.length; ++i) {
			this.__container__.factory.dispose(habitats[i]);
			Habitat.destroy(habitats[i]);
		}

		// Lifecycle event
		if (typeof this.didUnmountHabitats === 'function') {
			this.didUnmountHabitats();
		}

		// Handle callback
		_callback(cb, this);
	}