fastify-sse-v2
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -24,2 +24,3 @@ "use strict"; | ||
instance.decorateReply("sse", function (source) { | ||
var _a; | ||
//if this already set, it's not first event | ||
@@ -42,2 +43,6 @@ if (!this.raw.headersSent) { | ||
else { | ||
if (!((_a = this.sseContext) === null || _a === void 0 ? void 0 : _a.source)) { | ||
this.sseContext = { source: (0, it_pushable_1.default)() }; | ||
handleAsyncIterable(this, this.sseContext.source); | ||
} | ||
this.sseContext.source.push(source); | ||
@@ -44,0 +49,0 @@ return; |
{ | ||
"name": "fastify-sse-v2", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Fastify plugin for sending server side events.", | ||
@@ -31,4 +31,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@chainsafe/eslint-config": "^1.1.0", | ||
"@rushstack/eslint-patch": "^1.2.0", | ||
"@chainsafe/eslint-config": "^2.0.0", | ||
"@types/chai": "^4.1.7", | ||
@@ -35,0 +34,0 @@ "@types/eventsource": "^1.1.2", |
@@ -37,2 +37,6 @@ import { EventMessage, FastifyPluginAsync, FastifyReply } from "fastify"; | ||
} else { | ||
if (!this.sseContext?.source) { | ||
this.sseContext = { source: pushable<EventMessage>() }; | ||
handleAsyncIterable(this, this.sseContext.source); | ||
} | ||
this.sseContext.source.push(source); | ||
@@ -39,0 +43,0 @@ return; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19200
14
374