@arcgis/map-components
Version:
ArcGIS Map Components
30 lines (29 loc) • 651 B
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import { watch as u } from "@arcgis/core/core/reactiveUtils.js";
import { makeController as y } from "@arcgis/lumina/controllers";
function v(r, e) {
return y((f, a) => (a.onLifecycle(
() => u(
() => ({
layerId: r.mapLayerId,
viewReady: r.view?.ready
}),
({ layerId: i, viewReady: t }) => {
if (!t)
return;
const d = r.view;
if (!i) {
e(void 0);
return;
}
e(d?.map?.findLayerById(i));
},
{
initial: !0
}
)
), r.mapLayerId));
}
export {
v as u
};