alinea
Version:
[](https://npmjs.org/package/alinea) [](https://packagephobia.com/result?p=alinea)
26 lines (23 loc) • 438 B
JavaScript
import "../../chunks/chunk-U5RRZUYZ.js";
// src/cli/serve/LiveReload.ts
var LiveReload = class {
clients = [];
constructor() {
}
reload(type) {
for (const client of this.clients) {
client.write(`data: ${type}
`);
if (type === "reload")
client.close();
}
if (type === "reload")
this.clients.length = 0;
}
register(client) {
this.clients.push(client);
}
};
export {
LiveReload
};