htmx-router 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/event-source.js +4 -2
- package/package.json +1 -1
- package/status.d.ts +7 -3
package/event-source.js
CHANGED
|
@@ -71,8 +71,10 @@ export class EventSource {
|
|
|
71
71
|
return this.sendText("\n\n", false);
|
|
72
72
|
}
|
|
73
73
|
dispatch(type, data) {
|
|
74
|
-
if (this.#state
|
|
75
|
-
|
|
74
|
+
if (this.#state === EventSource.CLOSED) {
|
|
75
|
+
const err = new Error(`Warn: Attempted to dispatch event "${type}" to a closed connection for: ${this.url}`, {});
|
|
76
|
+
console.warn(err);
|
|
77
|
+
}
|
|
76
78
|
return this.sendText(`event: ${type}\ndata: ${data}\n\n`, true);
|
|
77
79
|
}
|
|
78
80
|
close(unlink = true) {
|
package/package.json
CHANGED
package/status.d.ts
CHANGED
|
@@ -64,7 +64,11 @@ declare const dictionary: {
|
|
|
64
64
|
511: "Network Authentication Required";
|
|
65
65
|
};
|
|
66
66
|
type Definitions = typeof dictionary;
|
|
67
|
-
export type
|
|
68
|
-
export type StatusText = Definitions[
|
|
69
|
-
export declare function MakeStatus(lookup:
|
|
67
|
+
export type StatusCode = keyof Definitions;
|
|
68
|
+
export type StatusText = Definitions[StatusCode];
|
|
69
|
+
export declare function MakeStatus(lookup: StatusCode | StatusText, init?: ResponseInit | Headers): ResponseInit;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated
|
|
72
|
+
*/
|
|
73
|
+
export type Status = StatusCode;
|
|
70
74
|
export {};
|