use-next-sse 0.2.3 → 1.0.0

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.
@@ -89,5 +89,5 @@ type SSEOptions = {
89
89
  * - `Cache-Control`: `no-cache, no-transform`
90
90
  * - `Connection`: `keep-alive`
91
91
  */
92
- export declare function createSSEHandler(callback: SSECallback, options?: SSEOptions): (request: NextRequest) => Promise<Response>;
92
+ export declare function createSSEHandler(callback: SSECallback, options?: SSEOptions): (request: NextRequest, context?: any) => Promise<Response>;
93
93
  export {};
@@ -37,7 +37,7 @@ exports.createSSEHandler = void 0;
37
37
  * - `Connection`: `keep-alive`
38
38
  */
39
39
  function createSSEHandler(callback, options) {
40
- return async function (request) {
40
+ return async function (request, context) {
41
41
  const encoder = new TextEncoder();
42
42
  let isClosed = false;
43
43
  let cleanup = options === null || options === void 0 ? void 0 : options.onClose;
@@ -89,5 +89,5 @@ type SSEOptions = {
89
89
  * - `Cache-Control`: `no-cache, no-transform`
90
90
  * - `Connection`: `keep-alive`
91
91
  */
92
- export declare function createSSEHandler(callback: SSECallback, options?: SSEOptions): (request: NextRequest) => Promise<Response>;
92
+ export declare function createSSEHandler(callback: SSECallback, options?: SSEOptions): (request: NextRequest, context?: any) => Promise<Response>;
93
93
  export {};
@@ -34,7 +34,7 @@
34
34
  * - `Connection`: `keep-alive`
35
35
  */
36
36
  export function createSSEHandler(callback, options) {
37
- return async function (request) {
37
+ return async function (request, context) {
38
38
  const encoder = new TextEncoder();
39
39
  let isClosed = false;
40
40
  let cleanup = options === null || options === void 0 ? void 0 : options.onClose;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-next-sse",
3
- "version": "0.2.3",
3
+ "version": "1.0.0",
4
4
  "description": "A lightweight Server-Sent Events (SSE) library for Next.js, enabling real-time, unidirectional data streaming from server to client",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -33,7 +33,7 @@
33
33
  "author": "Alexander Kasten",
34
34
  "license": "MIT",
35
35
  "peerDependencies": {
36
- "next": ">=13.5.9 >=14.2.25 >=15.2.3",
36
+ "next": ">=13.5.9 || >=14.2.25 || >=15.5.6 || >=16.0.0",
37
37
  "react": ">=18.0.0",
38
38
  "react-dom": ">=18.0.0"
39
39
  },