/**
 * @license
 * Copyright 2025-2026 Open Home Foundation
 * SPDX-License-Identifier: Apache-2.0
 */
function handleAsync(fn, onError) {
  return () => {
    fn().catch((error) => {
      console.error("Async operation failed:", error);
      onError?.(error);
    });
  };
}
function handleAsyncEvent(fn, onError) {
  return (event) => {
    fn(event).catch((error) => {
      console.error("Async operation failed:", error);
      onError?.(error);
    });
  };
}
function fireAndForget(promise, onError) {
  promise.catch((error) => {
    console.error("Async operation failed:", error);
    onError?.(error);
  });
}
export {
  fireAndForget,
  handleAsync,
  handleAsyncEvent
};
//# sourceMappingURL=async-handler.js.map
