hydrateIsland method
Manually triggers hydration of the island hosted at element.
Returns the resulting BloomMountHandle, or null if hydration failed.
final element = web.document.querySelector('#special-island')!;
await orchestrator.hydrateIsland(element);
Implementation
Future<BloomMountHandle?> hydrateIsland(web.Element element) async {
if (_disposed) return null;
var instance = _islands.cast<BloomIslandInstance?>().firstWhere(
(inst) => inst?.element == element,
orElse: () => null,
);
if (instance == null) {
final newOnes = scan(element);
if (newOnes.isNotEmpty) {
instance = newOnes.first;
}
}
return instance?.hydrate();
}