@laravel/stream-vue 0.3.0 → 0.3.2

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/README.md CHANGED
@@ -155,6 +155,39 @@ const { isFetching, isStreaming } = useStream("chat", { id: props.id });
155
155
  </template>
156
156
  ```
157
157
 
158
+ The `useJsonStream` hook is identical to the `useStream` hook except that it will attempt to parse the data as JSON once it has finished streaming:
159
+
160
+ ```vue
161
+ <script setup lang="ts">
162
+ import { useJsonStream } from "@laravel/stream-vue";
163
+
164
+ type User = {
165
+ id: number;
166
+ name: string;
167
+ email: string;
168
+ };
169
+
170
+ const { data, send } = useJsonStream<{ users: User[] }>("users");
171
+
172
+ const loadUsers = () => {
173
+ send({
174
+ query: "taylor",
175
+ });
176
+ };
177
+ </script>
178
+
179
+ <template>
180
+ <div>
181
+ <ul>
182
+ <li v-for="user in data?.users" :key="user.id">
183
+ {{ user.id }}: {{ user.name }}
184
+ </li>
185
+ </ul>
186
+ <button @click="loadUsers">Load Users</button>
187
+ </div>
188
+ </template>
189
+ ```
190
+
158
191
  ## Event Streams (SSE)
159
192
 
160
193
  The `useEventStream` hook allows you to seamlessly consume [Server-Sent Events (SSE)](https://laravel.com/docs/responses#event-streams) in your Vue application.
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ declare type StreamOptions = {
22
22
  initialInput?: Record<string, any>;
23
23
  headers?: Record<string, string>;
24
24
  csrfToken?: string;
25
+ json?: boolean;
25
26
  onResponse?: (response: Response) => void;
26
27
  onData?: (data: string) => void;
27
28
  onCancel?: () => void;
@@ -41,13 +42,26 @@ declare type StreamOptions = {
41
42
  */
42
43
  export declare const useEventStream: (url: string, { eventName, endSignal, glue, replace, onMessage, onComplete, onError, }?: EventStreamOptions) => EventStreamResult;
43
44
 
44
- export declare const useStream: (url: string, options?: StreamOptions) => {
45
- data: Readonly<Ref<string, string>>;
46
- isFetching: Readonly<Ref<boolean, boolean>>;
47
- isStreaming: Readonly<Ref<boolean, boolean>>;
45
+ export declare const useJsonStream: <TJsonData = null>(url: string, options?: Omit<StreamOptions, "json">) => {
46
+ isFetching: Readonly<Ref<boolean>>;
47
+ isStreaming: Readonly<Ref<boolean>>;
48
48
  id: string;
49
49
  send: (body: Record<string, any>) => void;
50
50
  cancel: () => void;
51
+ clearData: () => void;
52
+ data: Readonly<TJsonData | null>;
53
+ strData: Readonly<Ref<string, string>>;
54
+ };
55
+
56
+ export declare const useStream: <TJsonData = null>(url: string, options?: StreamOptions) => {
57
+ data: Readonly<Ref<string>>;
58
+ jsonData: Readonly<TJsonData | null>;
59
+ isFetching: Readonly<Ref<boolean>>;
60
+ isStreaming: Readonly<Ref<boolean>>;
61
+ id: string;
62
+ send: (body: Record<string, any>) => void;
63
+ cancel: () => void;
64
+ clearData: () => void;
51
65
  };
52
66
 
53
67
  export { }
package/dist/index.es.js CHANGED
@@ -1,159 +1,185 @@
1
- import { ref as m, onMounted as k, onUnmounted as x, watch as D, readonly as v } from "vue";
2
- const C = "data: ", q = (r, {
1
+ import { ref as S, onMounted as x, onUnmounted as O, watch as q, readonly as v } from "vue";
2
+ const M = "data: ", $ = (t, {
3
3
  eventName: e = "update",
4
- endSignal: s = "</stream>",
5
- glue: o = " ",
6
- replace: A = !1,
4
+ endSignal: r = "</stream>",
5
+ glue: l = " ",
6
+ replace: w = !1,
7
7
  onMessage: b = () => null,
8
- onComplete: S = () => null,
9
- onError: w = () => null
8
+ onComplete: D = () => null,
9
+ onError: E = () => null
10
10
  } = {}) => {
11
- const f = m(""), l = m([]), g = Array.isArray(e) ? e : [e];
11
+ const d = S(""), f = S([]), u = Array.isArray(e) ? e : [e];
12
12
  let c = null;
13
13
  const h = () => {
14
- f.value = "", l.value = [];
15
- }, d = (t = !1) => {
16
- g.forEach((u) => {
17
- c == null || c.removeEventListener(u, a);
18
- }), c == null || c.close(), c = null, t && h();
19
- }, a = (t) => {
20
- if ([s, `${C}${s}`].includes(t.data)) {
21
- d(), S();
14
+ d.value = "", f.value = [];
15
+ }, g = (a = !1) => {
16
+ u.forEach((s) => {
17
+ c == null || c.removeEventListener(s, y);
18
+ }), c == null || c.close(), c = null, a && h();
19
+ }, y = (a) => {
20
+ if ([r, `${M}${r}`].includes(a.data)) {
21
+ g(), D();
22
22
  return;
23
23
  }
24
- A && h(), l.value.push(
25
- t.data.startsWith(C) ? t.data.substring(C.length) : t.data
26
- ), f.value = l.value.join(o), b(t);
27
- }, i = (t) => {
28
- w(t), d();
24
+ w && h(), f.value.push(
25
+ a.data.startsWith(M) ? a.data.substring(M.length) : a.data
26
+ ), d.value = f.value.join(l), b(a);
27
+ }, j = (a) => {
28
+ E(a), g();
29
29
  }, n = () => {
30
- h(), c = new EventSource(r), g.forEach((t) => {
31
- c.addEventListener(t, a);
32
- }), c.addEventListener("error", i);
30
+ h(), c = new EventSource(t), u.forEach((a) => {
31
+ c.addEventListener(a, y);
32
+ }), c.addEventListener("error", j);
33
33
  };
34
- return k(() => {
34
+ return x(() => {
35
35
  n();
36
- }), x(() => {
37
- d();
38
- }), D(
39
- () => r,
40
- (t, u) => {
41
- t !== u && (d(), n());
36
+ }), O(() => {
37
+ g();
38
+ }), q(
39
+ () => t,
40
+ (a, s) => {
41
+ a !== s && (g(), n());
42
42
  }
43
43
  ), {
44
- message: v(f),
45
- messageParts: v(l),
46
- close: d,
44
+ message: v(d),
45
+ messageParts: v(f),
46
+ close: g,
47
47
  clearMessage: h
48
48
  };
49
- }, P = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
50
- let I = (r = 21) => {
51
- let e = "", s = crypto.getRandomValues(new Uint8Array(r |= 0));
52
- for (; r--; )
53
- e += P[s[r] & 63];
49
+ }, N = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
50
+ let X = (t = 21) => {
51
+ let e = "", r = crypto.getRandomValues(new Uint8Array(t |= 0));
52
+ for (; t--; )
53
+ e += N[r[t] & 63];
54
54
  return e;
55
55
  };
56
- const F = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), y = (r) => {
57
- const e = F.get(r);
58
- return e || (F.set(r, {
56
+ const A = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), L = (t) => {
57
+ const e = A.get(t);
58
+ if (e)
59
+ return e;
60
+ const r = {
59
61
  controller: new AbortController(),
60
62
  data: "",
61
63
  isFetching: !1,
62
- isStreaming: !1
63
- }), F.get(r));
64
- }, T = (r) => (E.has(r) || E.set(r, []), E.get(r)), O = (r, e) => (T(r).push(e), () => {
65
- E.set(
66
- r,
67
- T(r).filter((s) => s !== e)
68
- );
69
- }), X = (r, e = {}) => {
70
- const s = e.id ?? I(), o = m(y(s)), A = (() => {
71
- var n;
72
- const a = {
64
+ isStreaming: !1,
65
+ jsonData: null
66
+ };
67
+ return A.set(t, r), r;
68
+ }, P = (t) => (i.has(t) || i.set(t, []), i.get(t)), I = (t) => {
69
+ var e;
70
+ return i.has(t) && ((e = i.get(t)) == null ? void 0 : e.length);
71
+ }, K = (t, e) => (P(t).push(e), () => {
72
+ i.set(
73
+ t,
74
+ P(t).filter((r) => r !== e)
75
+ ), I(t) || (A.delete(t), i.delete(t));
76
+ }), V = (t, e = {}) => {
77
+ const r = e.id ?? X(), l = S(L(r)), w = (() => {
78
+ var s;
79
+ const n = {
73
80
  "Content-Type": "application/json",
74
- "X-STREAM-ID": s
75
- }, i = e.csrfToken ?? ((n = document.querySelector('meta[name="csrf-token"]')) == null ? void 0 : n.getAttribute("content"));
76
- return i && (a["X-CSRF-TOKEN"] = i), a;
77
- })(), b = m(o.value.data), S = m(o.value.isFetching), w = m(o.value.isStreaming);
81
+ "X-STREAM-ID": r
82
+ }, a = e.csrfToken ?? ((s = document.querySelector('meta[name="csrf-token"]')) == null ? void 0 : s.getAttribute("content"));
83
+ return a && (n["X-CSRF-TOKEN"] = a), n;
84
+ })(), b = S(l.value.data), D = S(l.value.jsonData), E = S(l.value.isFetching), d = S(l.value.isStreaming);
78
85
  let f;
79
- const l = (a) => {
80
- var n;
81
- F.set(s, {
82
- ...y(s),
83
- ...a
86
+ const u = (n) => {
87
+ var s;
88
+ A.set(r, {
89
+ ...L(r),
90
+ ...n
84
91
  });
85
- const i = y(s);
86
- (n = E.get(s)) == null || n.forEach((t) => t(i));
87
- }, g = () => {
88
- var a;
89
- o.value.controller.abort(), (S || w) && ((a = e.onCancel) == null || a.call(e)), l({
92
+ const a = L(r);
93
+ (s = i.get(r)) == null || s.forEach((o) => o(a));
94
+ }, c = () => {
95
+ var n;
96
+ l.value.controller.abort(), (E || d) && ((n = e.onCancel) == null || n.call(e)), u({
90
97
  isFetching: !1,
91
98
  isStreaming: !1
92
99
  });
93
- }, c = (a = {}) => {
94
- const i = new AbortController();
95
- l({
100
+ }, h = (n = {}) => {
101
+ const a = new AbortController();
102
+ u({
96
103
  isFetching: !0,
97
- controller: i
98
- }), fetch(r, {
104
+ controller: a
105
+ }), fetch(t, {
99
106
  method: "POST",
100
- signal: i.signal,
107
+ signal: a.signal,
101
108
  headers: {
102
- ...A,
109
+ ...w,
103
110
  ...e.headers ?? {}
104
111
  },
105
- body: JSON.stringify(a)
106
- }).then(async (n) => {
107
- var t;
108
- if (!n.ok) {
109
- const u = await n.text();
110
- throw new Error(u);
112
+ body: JSON.stringify(n)
113
+ }).then(async (s) => {
114
+ var o;
115
+ if (!s.ok) {
116
+ const m = await s.text();
117
+ throw new Error(m);
111
118
  }
112
- if (!n.body)
119
+ if (!s.body)
113
120
  throw new Error(
114
121
  "ReadableStream not yet supported in this browser."
115
122
  );
116
- return (t = e.onResponse) == null || t.call(e, n), l({
123
+ return (o = e.onResponse) == null || o.call(e, s), u({
117
124
  isFetching: !1,
118
125
  isStreaming: !0
119
- }), d(n.body.getReader());
120
- }).catch((n) => {
121
- var t, u;
122
- l({
126
+ }), j(s.body.getReader());
127
+ }).catch((s) => {
128
+ var o, m;
129
+ u({
123
130
  isFetching: !1,
124
131
  isStreaming: !1
125
- }), (t = e.onError) == null || t.call(e, n), (u = e.onFinish) == null || u.call(e);
132
+ }), (o = e.onError) == null || o.call(e, s), (m = e.onFinish) == null || m.call(e);
126
133
  });
127
- }, h = (a) => {
128
- g(), c(a), l({
129
- data: ""
134
+ }, g = (n) => {
135
+ c(), h(n), y();
136
+ }, y = () => {
137
+ u({
138
+ data: "",
139
+ jsonData: null
130
140
  });
131
- }, d = (a, i = "") => a.read().then(({ done: n, value: t }) => {
132
- var M, R;
133
- const u = new TextDecoder("utf-8").decode(t), L = i + u;
134
- return (M = e.onData) == null || M.call(e, u), n ? (l({
135
- data: L,
136
- isStreaming: !1
137
- }), (R = e.onFinish) == null || R.call(e), "") : (l({
138
- data: L
139
- }), d(a, L));
141
+ }, j = (n, a = "") => n.read().then(({ done: s, value: o }) => {
142
+ var R, T, k;
143
+ const m = new TextDecoder("utf-8").decode(o), C = a + m;
144
+ (R = e.onData) == null || R.call(e, m);
145
+ const F = {
146
+ data: C
147
+ };
148
+ if (!s)
149
+ return u(F), j(n, C);
150
+ if (F.isStreaming = !1, e.json)
151
+ try {
152
+ F.jsonData = JSON.parse(C);
153
+ } catch (J) {
154
+ (T = e.onError) == null || T.call(e, J);
155
+ }
156
+ return u(F), (k = e.onFinish) == null || k.call(e), "";
140
157
  });
141
- return k(() => {
142
- f = O(s, (a) => {
143
- o.value = y(s), S.value = a.isFetching, w.value = a.isStreaming, b.value = a.data;
144
- }), window.addEventListener("beforeunload", g), e.initialInput && c(e.initialInput);
145
- }), x(() => {
146
- f(), window.removeEventListener("beforeunload", g);
158
+ return x(() => {
159
+ f = K(r, (n) => {
160
+ l.value = L(r), E.value = n.isFetching, d.value = n.isStreaming, b.value = n.data, D.value = n.jsonData;
161
+ }), window.addEventListener("beforeunload", c), e.initialInput && h(e.initialInput);
162
+ }), O(() => {
163
+ f(), window.removeEventListener("beforeunload", c), I(r) || c();
147
164
  }), {
148
165
  data: v(b),
149
- isFetching: v(S),
150
- isStreaming: v(w),
151
- id: s,
152
- send: h,
153
- cancel: g
166
+ jsonData: v(D),
167
+ isFetching: v(E),
168
+ isStreaming: v(d),
169
+ id: r,
170
+ send: g,
171
+ cancel: c,
172
+ clearData: y
154
173
  };
174
+ }, B = (t, e = {}) => {
175
+ const { jsonData: r, data: l, ...w } = V(t, {
176
+ ...e,
177
+ json: !0
178
+ });
179
+ return { data: r, strData: l, ...w };
155
180
  };
156
181
  export {
157
- q as useEventStream,
158
- X as useStream
182
+ $ as useEventStream,
183
+ B as useJsonStream,
184
+ V as useStream
159
185
  };
package/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(u,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(u=typeof globalThis<"u"?globalThis:u||self,r(u.LaravelStreamVue={},u.Vue))})(this,function(u,r){"use strict";const v="data: ",k=(a,{eventName:e="update",endSignal:l="</stream>",glue:g=" ",replace:L=!1,onMessage:T=()=>null,onComplete:w=()=>null,onError:E=()=>null}={})=>{const m=r.ref(""),i=r.ref([]),h=Array.isArray(e)?e:[e];let c=null;const S=()=>{m.value="",i.value=[]},f=(t=!1)=>{h.forEach(o=>{c==null||c.removeEventListener(o,n)}),c==null||c.close(),c=null,t&&S()},n=t=>{if([l,`${v}${l}`].includes(t.data)){f(),w();return}L&&S(),i.value.push(t.data.startsWith(v)?t.data.substring(v.length):t.data),m.value=i.value.join(g),T(t)},d=t=>{E(t),f()},s=()=>{S(),c=new EventSource(a),h.forEach(t=>{c.addEventListener(t,n)}),c.addEventListener("error",d)};return r.onMounted(()=>{s()}),r.onUnmounted(()=>{f()}),r.watch(()=>a,(t,o)=>{t!==o&&(f(),s())}),{message:r.readonly(m),messageParts:r.readonly(i),close:f,clearMessage:S}},P="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let j=(a=21)=>{let e="",l=crypto.getRandomValues(new Uint8Array(a|=0));for(;a--;)e+=P[l[a]&63];return e};const b=new Map,y=new Map,F=a=>{const e=b.get(a);return e||(b.set(a,{controller:new AbortController,data:"",isFetching:!1,isStreaming:!1}),b.get(a))},A=a=>(y.has(a)||y.set(a,[]),y.get(a)),x=(a,e)=>(A(a).push(e),()=>{y.set(a,A(a).filter(l=>l!==e))}),D=(a,e={})=>{const l=e.id??j(),g=r.ref(F(l)),L=(()=>{var s;const n={"Content-Type":"application/json","X-STREAM-ID":l},d=e.csrfToken??((s=document.querySelector('meta[name="csrf-token"]'))==null?void 0:s.getAttribute("content"));return d&&(n["X-CSRF-TOKEN"]=d),n})(),T=r.ref(g.value.data),w=r.ref(g.value.isFetching),E=r.ref(g.value.isStreaming);let m;const i=n=>{var s;b.set(l,{...F(l),...n});const d=F(l);(s=y.get(l))==null||s.forEach(t=>t(d))},h=()=>{var n;g.value.controller.abort(),(w||E)&&((n=e.onCancel)==null||n.call(e)),i({isFetching:!1,isStreaming:!1})},c=(n={})=>{const d=new AbortController;i({isFetching:!0,controller:d}),fetch(a,{method:"POST",signal:d.signal,headers:{...L,...e.headers??{}},body:JSON.stringify(n)}).then(async s=>{var t;if(!s.ok){const o=await s.text();throw new Error(o)}if(!s.body)throw new Error("ReadableStream not yet supported in this browser.");return(t=e.onResponse)==null||t.call(e,s),i({isFetching:!1,isStreaming:!0}),f(s.body.getReader())}).catch(s=>{var t,o;i({isFetching:!1,isStreaming:!1}),(t=e.onError)==null||t.call(e,s),(o=e.onFinish)==null||o.call(e)})},S=n=>{h(),c(n),i({data:""})},f=(n,d="")=>n.read().then(({done:s,value:t})=>{var C,R;const o=new TextDecoder("utf-8").decode(t),M=d+o;return(C=e.onData)==null||C.call(e,o),s?(i({data:M,isStreaming:!1}),(R=e.onFinish)==null||R.call(e),""):(i({data:M}),f(n,M))});return r.onMounted(()=>{m=x(l,n=>{g.value=F(l),w.value=n.isFetching,E.value=n.isStreaming,T.value=n.data}),window.addEventListener("beforeunload",h),e.initialInput&&c(e.initialInput)}),r.onUnmounted(()=>{m(),window.removeEventListener("beforeunload",h)}),{data:r.readonly(T),isFetching:r.readonly(w),isStreaming:r.readonly(E),id:l,send:S,cancel:h}};u.useEventStream=k,u.useStream=D,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
1
+ (function(u,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(u=typeof globalThis<"u"?globalThis:u||self,n(u.LaravelStreamVue={},u.Vue))})(this,function(u,n){"use strict";const M="data: ",q=(t,{eventName:e="update",endSignal:r="</stream>",glue:o=" ",replace:w=!1,onMessage:F=()=>null,onComplete:L=()=>null,onError:E=()=>null}={})=>{const h=n.ref(""),m=n.ref([]),d=Array.isArray(e)?e:[e];let c=null;const g=()=>{h.value="",m.value=[]},S=(a=!1)=>{d.forEach(l=>{c==null||c.removeEventListener(l,b)}),c==null||c.close(),c=null,a&&g()},b=a=>{if([r,`${M}${r}`].includes(a.data)){S(),L();return}w&&g(),m.value.push(a.data.startsWith(M)?a.data.substring(M.length):a.data),h.value=m.value.join(o),F(a)},T=a=>{E(a),S()},s=()=>{g(),c=new EventSource(t),d.forEach(a=>{c.addEventListener(a,b)}),c.addEventListener("error",T)};return n.onMounted(()=>{s()}),n.onUnmounted(()=>{S()}),n.watch(()=>t,(a,l)=>{a!==l&&(S(),s())}),{message:n.readonly(h),messageParts:n.readonly(m),close:S,clearMessage:g}},x="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let I=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=x[r[t]&63];return e};const j=new Map,f=new Map,D=t=>{const e=j.get(t);if(e)return e;const r={controller:new AbortController,data:"",isFetching:!1,isStreaming:!1,jsonData:null};return j.set(t,r),r},C=t=>(f.has(t)||f.set(t,[]),f.get(t)),R=t=>{var e;return f.has(t)&&((e=f.get(t))==null?void 0:e.length)},V=(t,e)=>(C(t).push(e),()=>{f.set(t,C(t).filter(r=>r!==e)),R(t)||(j.delete(t),f.delete(t))}),P=(t,e={})=>{const r=e.id??I(),o=n.ref(D(r)),w=(()=>{var l;const s={"Content-Type":"application/json","X-STREAM-ID":r},a=e.csrfToken??((l=document.querySelector('meta[name="csrf-token"]'))==null?void 0:l.getAttribute("content"));return a&&(s["X-CSRF-TOKEN"]=a),s})(),F=n.ref(o.value.data),L=n.ref(o.value.jsonData),E=n.ref(o.value.isFetching),h=n.ref(o.value.isStreaming);let m;const d=s=>{var l;j.set(r,{...D(r),...s});const a=D(r);(l=f.get(r))==null||l.forEach(i=>i(a))},c=()=>{var s;o.value.controller.abort(),(E||h)&&((s=e.onCancel)==null||s.call(e)),d({isFetching:!1,isStreaming:!1})},g=(s={})=>{const a=new AbortController;d({isFetching:!0,controller:a}),fetch(t,{method:"POST",signal:a.signal,headers:{...w,...e.headers??{}},body:JSON.stringify(s)}).then(async l=>{var i;if(!l.ok){const y=await l.text();throw new Error(y)}if(!l.body)throw new Error("ReadableStream not yet supported in this browser.");return(i=e.onResponse)==null||i.call(e,l),d({isFetching:!1,isStreaming:!0}),T(l.body.getReader())}).catch(l=>{var i,y;d({isFetching:!1,isStreaming:!1}),(i=e.onError)==null||i.call(e,l),(y=e.onFinish)==null||y.call(e)})},S=s=>{c(),g(s),b()},b=()=>{d({data:"",jsonData:null})},T=(s,a="")=>s.read().then(({done:l,value:i})=>{var k,O,J;const y=new TextDecoder("utf-8").decode(i),A=a+y;(k=e.onData)==null||k.call(e,y);const v={data:A};if(!l)return d(v),T(s,A);if(v.isStreaming=!1,e.json)try{v.jsonData=JSON.parse(A)}catch(X){(O=e.onError)==null||O.call(e,X)}return d(v),(J=e.onFinish)==null||J.call(e),""});return n.onMounted(()=>{m=V(r,s=>{o.value=D(r),E.value=s.isFetching,h.value=s.isStreaming,F.value=s.data,L.value=s.jsonData}),window.addEventListener("beforeunload",c),e.initialInput&&g(e.initialInput)}),n.onUnmounted(()=>{m(),window.removeEventListener("beforeunload",c),R(r)||c()}),{data:n.readonly(F),jsonData:n.readonly(L),isFetching:n.readonly(E),isStreaming:n.readonly(h),id:r,send:S,cancel:c,clearData:b}},N=(t,e={})=>{const{jsonData:r,data:o,...w}=P(t,{...e,json:!0});return{data:r,strData:o,...w}};u.useEventStream=q,u.useJsonStream=N,u.useStream=P,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laravel/stream-vue",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Laravel streaming hooks for Vue",
5
5
  "keywords": [
6
6
  "laravel",