{"version":3,"file":"useUpdateHostPathnameOnRemote.mjs","names":[],"sources":["../../../src/hooks/useUpdateHostPathnameOnRemote.ts"],"sourcesContent":["import { type HostToRemoteConnection } from \"@mittwald/flow-remote-core\";\nimport { useLayoutEffect } from \"react\";\n\n/** Updates the host pathname in the remote connection. */\nexport const useUpdateHostPathnameOnRemote = (\n  hostPathname?: string,\n  connection?: HostToRemoteConnection,\n) => {\n  useLayoutEffect(() => {\n    if (hostPathname === undefined || !connection) {\n      return;\n    }\n\n    const { updateHostPathname } = connection;\n    updateHostPathname(hostPathname);\n  }, [hostPathname, connection]);\n};\n"],"mappings":";;;;;;AAIA,IAAa,iCACX,cACA,eACG;CACH,sBAAsB;EACpB,IAAI,iBAAiB,KAAA,KAAa,CAAC,YACjC;EAGF,MAAM,EAAE,uBAAuB;EAC/B,mBAAmB,YAAY;CACjC,GAAG,CAAC,cAAc,UAAU,CAAC;AAC/B"}