@tapsioss/client-socket-manager
Version:
<div align="center">
17 lines (16 loc) • 542 B
JavaScript
export const isBrowser = () => typeof document !== "undefined";
export const assertCallbackType = (cb, message) => {
if (typeof cb !== "function") {
throw new TypeError(`ClientSocketManager: ${message}`);
}
return true;
};
export const warnDisposedClient = (isDisposed) => {
if (!isDisposed)
return;
// eslint-disable-next-line no-console
console.warn([
"ClientSocketManager: Attempted to use a disposed client.",
"Please reassign the client with a new instance.",
].join(" "));
};