+sse test
This commit is contained in:
parent
19cf309392
commit
2289aa31fd
61 changed files with 2250 additions and 0 deletions
1
sse/be/static/_app/immutable/nodes/0.JKa0J41q.js
Normal file
1
sse/be/static/_app/immutable/nodes/0.JKa0J41q.js
Normal file
|
@ -0,0 +1 @@
|
|||
import{s as l,c as r,u as i,g as u,d as f}from"../chunks/scheduler.k-kUyWhY.js";import{S as _,i as c,d as p,t as d}from"../chunks/index.PctGSwCt.js";const m=!0,g=!1,$="always",v=Object.freeze(Object.defineProperty({__proto__:null,prerender:m,ssr:g,trailingSlash:$},Symbol.toStringTag,{value:"Module"}));function y(n){let s;const a=n[1].default,e=r(a,n,n[0],null);return{c(){e&&e.c()},l(t){e&&e.l(t)},m(t,o){e&&e.m(t,o),s=!0},p(t,[o]){e&&e.p&&(!s||o&1)&&i(e,a,t,t[0],s?f(a,t[0],o,null):u(t[0]),null)},i(t){s||(p(e,t),s=!0)},o(t){d(e,t),s=!1},d(t){e&&e.d(t)}}}function S(n,s,a){let{$$slots:e={},$$scope:t}=s;return n.$$set=o=>{"$$scope"in o&&a(0,t=o.$$scope)},[t,e]}class j extends _{constructor(s){super(),c(this,s,S,y,l,{})}}export{j as component,v as universal};
|
BIN
sse/be/static/_app/immutable/nodes/0.JKa0J41q.js.br
Normal file
BIN
sse/be/static/_app/immutable/nodes/0.JKa0J41q.js.br
Normal file
Binary file not shown.
BIN
sse/be/static/_app/immutable/nodes/0.JKa0J41q.js.gz
Normal file
BIN
sse/be/static/_app/immutable/nodes/0.JKa0J41q.js.gz
Normal file
Binary file not shown.
1
sse/be/static/_app/immutable/nodes/1.Veb9jVKm.js
Normal file
1
sse/be/static/_app/immutable/nodes/1.Veb9jVKm.js
Normal file
|
@ -0,0 +1 @@
|
|||
import{s as E,n as b,e as x}from"../chunks/scheduler.k-kUyWhY.js";import{S,i as j,g as _,m as f,s as q,h as d,j as g,n as h,f as p,c as y,a as l,x as v,o as $}from"../chunks/index.PctGSwCt.js";import{d as C}from"../chunks/singletons.4aHkxUVP.js";const H=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},P={subscribe(s){return H().page.subscribe(s)}};function k(s){let t,r=s[0].status+"",o,n,i,c=s[0].error?.message+"",u;return{c(){t=_("h1"),o=f(r),n=q(),i=_("p"),u=f(c)},l(e){t=d(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(p),n=y(e),i=d(e,"P",{});var m=g(i);u=h(m,c),m.forEach(p)},m(e,a){l(e,t,a),v(t,o),l(e,n,a),l(e,i,a),v(i,u)},p(e,[a]){a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=e[0].error?.message+"")&&$(u,c)},i:b,o:b,d(e){e&&(p(t),p(n),p(i))}}}function w(s,t,r){let o;return x(s,P,n=>r(0,o=n)),[o]}let D=class extends S{constructor(t){super(),j(this,t,w,k,E,{})}};export{D as component};
|
BIN
sse/be/static/_app/immutable/nodes/1.Veb9jVKm.js.br
Normal file
BIN
sse/be/static/_app/immutable/nodes/1.Veb9jVKm.js.br
Normal file
Binary file not shown.
BIN
sse/be/static/_app/immutable/nodes/1.Veb9jVKm.js.gz
Normal file
BIN
sse/be/static/_app/immutable/nodes/1.Veb9jVKm.js.gz
Normal file
Binary file not shown.
1
sse/be/static/_app/immutable/nodes/2.W8D06jmS.js
Normal file
1
sse/be/static/_app/immutable/nodes/2.W8D06jmS.js
Normal file
|
@ -0,0 +1 @@
|
|||
import{s as d,n as l}from"../chunks/scheduler.k-kUyWhY.js";import{S as h,i as u,g as m,s as _,h as p,y as v,c as x,a as i,f as o}from"../chunks/index.PctGSwCt.js";function C(f){let t,r="Welcome to SvelteKit",a,s,c='Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation';return{c(){t=m("h1"),t.textContent=r,a=_(),s=m("p"),s.innerHTML=c},l(e){t=p(e,"H1",{"data-svelte-h":!0}),v(t)!=="svelte-yyjjjs"&&(t.textContent=r),a=x(e),s=p(e,"P",{"data-svelte-h":!0}),v(s)!=="svelte-jl9sbz"&&(s.innerHTML=c)},m(e,n){i(e,t,n),i(e,a,n),i(e,s,n)},p:l,i:l,o:l,d(e){e&&(o(t),o(a),o(s))}}}class H extends h{constructor(t){super(),u(this,t,null,C,d,{})}}export{H as component};
|
BIN
sse/be/static/_app/immutable/nodes/2.W8D06jmS.js.br
Normal file
BIN
sse/be/static/_app/immutable/nodes/2.W8D06jmS.js.br
Normal file
Binary file not shown.
BIN
sse/be/static/_app/immutable/nodes/2.W8D06jmS.js.gz
Normal file
BIN
sse/be/static/_app/immutable/nodes/2.W8D06jmS.js.gz
Normal file
Binary file not shown.
1
sse/be/static/_app/immutable/nodes/3.79qhDZ-Z.js
Normal file
1
sse/be/static/_app/immutable/nodes/3.79qhDZ-Z.js
Normal file
|
@ -0,0 +1 @@
|
|||
import{s as N,n as y,r as O,o as D}from"../chunks/scheduler.k-kUyWhY.js";import{S as E,i as T,g as m,m as k,s as x,h as w,j as z,n as B,f as u,c as b,y as C,a as g,x as J,z as h,o as L}from"../chunks/index.PctGSwCt.js";function M(p){let c,s,n,i,o="send Msg",t,l,S="send Ping",d,r,v="send Pong",_,$;return{c(){c=m("h1"),s=k(p[0]),n=x(),i=m("button"),i.textContent=o,t=x(),l=m("button"),l.textContent=S,d=x(),r=m("button"),r.textContent=v},l(e){c=w(e,"H1",{});var a=z(c);s=B(a,p[0]),a.forEach(u),n=b(e),i=w(e,"BUTTON",{"data-svelte-h":!0}),C(i)!=="svelte-1a1zt14"&&(i.textContent=o),t=b(e),l=w(e,"BUTTON",{"data-svelte-h":!0}),C(l)!=="svelte-iklzn2"&&(l.textContent=S),d=b(e),r=w(e,"BUTTON",{"data-svelte-h":!0}),C(r)!=="svelte-1i1hqj6"&&(r.textContent=v)},m(e,a){g(e,c,a),J(c,s),g(e,n,a),g(e,i,a),g(e,t,a),g(e,l,a),g(e,d,a),g(e,r,a),_||($=[h(i,"click",P),h(l,"click",U),h(r,"click",j)],_=!0)},p(e,[a]){a&1&&L(s,e[0])},i:y,o:y,d(e){e&&(u(c),u(n),u(i),u(t),u(l),u(d),u(r)),_=!1,O($)}}}function f(){return new Date(Date.now()).toISOString()}async function P(){await fetch("/api/msg")}async function U(){await fetch("/api/ping")}async function j(){await fetch("/api/pong")}function q(p,c,s){let n;function i(){const o=new EventSource("/api/sse");return console.log("subscribe"),o.onopen=()=>{console.log(`sse open ${f()}`),s(0,n=`sse open ${f()}`)},o.onerror=()=>{console.log(`sse error ${f()}`),o.readyState===EventSource.CONNECTING&&console.log(`sse reconnecting ${f()}`),s(0,n=`sse error ${f()}`)},o.onmessage=t=>{let l=JSON.parse(t.data);console.log(`received: ${JSON.stringify(l)}`),s(0,n=`received: ${JSON.stringify(l)} ${Date.now()}`)},o.addEventListener("ping",t=>{console.log(`ping: ${t.data}`),s(0,n=`ping: ${t.data} ${Date.now()}`)}),o.addEventListener("pong",t=>{console.log(`pong: ${t.data}`),s(0,n=`pong: ${t.data} ${Date.now()}`)}),o.addEventListener("message",t=>{console.log(`message: ${t.data}`),s(0,n=`message: ${t.data} ${Date.now()}`)}),()=>{o.close(),console.log(`sse closing ${Date.now()}`)}}return D(()=>i()),s(0,n=""),[n]}class H extends E{constructor(c){super(),T(this,c,q,M,N,{})}}export{H as component};
|
BIN
sse/be/static/_app/immutable/nodes/3.79qhDZ-Z.js.br
Normal file
BIN
sse/be/static/_app/immutable/nodes/3.79qhDZ-Z.js.br
Normal file
Binary file not shown.
BIN
sse/be/static/_app/immutable/nodes/3.79qhDZ-Z.js.gz
Normal file
BIN
sse/be/static/_app/immutable/nodes/3.79qhDZ-Z.js.gz
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue