Skip to content

Commit

Permalink
v5.3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgpearce committed Nov 3, 2024
1 parent a92a4bb commit 1991bae
Show file tree
Hide file tree
Showing 52 changed files with 264 additions and 258 deletions.
2 changes: 1 addition & 1 deletion coverage.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"tests":7456,"assertions":33183,"lines":{"total":2284,"covered":2284,"skipped":0,"pct":100},"statements":{"total":2465,"covered":2465,"skipped":0,"pct":100},"functions":{"total":985,"covered":985,"skipped":0,"pct":100},"branches":{"total":851,"covered":851,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}
{"tests":7456,"assertions":33189,"lines":{"total":2284,"covered":2284,"skipped":0,"pct":100},"statements":{"total":2465,"covered":2465,"skipped":0,"pct":100},"functions":{"total":985,"covered":985,"skipped":0,"pct":100},"branches":{"total":851,"covered":851,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}
43 changes: 22 additions & 21 deletions docs/api/all.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<nav><ul><li><a href="/">TinyBase</a></li><li><a href="/api/">API</a></li><li><a href="/api/persister-partykit-server/"><code>persister-partykit-server</code></a></li><li><a href="/api/persister-partykit-server/classes/">Classes</a></li><li><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/"><code>TinyBasePartyKitServer</code></a></li></ul></nav><section class="s1" id="/api/persister-partykit-server/classes/server/tinybasepartykitserver/" data-id="TBPKS"><h1><code>TinyBasePartyKitServer</code></h1><p>This extends the PartyKit Server class, which provides a selection of methods you are expected to implement. The TinyBasePartyKitServer implements only two of them, the <a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onmessage/"><code>onMessage</code></a> method and the <a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onrequest/"><code>onRequest</code></a> method, as well as the constructor.</p><p>If you wish to use TinyBasePartyKitServer as a general PartyKit server, you can implement other methods. But you must remember to call the super implementations of those methods to ensure the <a href="/">TinyBase</a> synchronization stays supported in addition to your own custom functionality. The same applies to the constructor if you choose to implement that.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>TinyBasePartyKitServer<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-partykit-server'</span><span class="punctuation">;</span>
<nav><ul><li><a href="/">TinyBase</a></li><li><a href="/api/">API</a></li><li><a href="/api/persister-partykit-server/"><code>persister-partykit-server</code></a></li><li><a href="/api/persister-partykit-server/classes/">Classes</a></li><li><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/"><code>TinyBasePartyKitServer</code></a></li></ul></nav><section class="s1" id="/api/persister-partykit-server/classes/server/tinybasepartykitserver/" data-id="TBPKS"><h1><code>TinyBasePartyKitServer</code></h1><p>This extends the PartyKit Server class, which provides a selection of methods you are expected to implement. The <code>TinyBasePartyKitServer</code> implements only two of them, the <a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onmessage/"><code>onMessage</code></a> method and the <a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onrequest/"><code>onRequest</code></a> method, as well as the constructor.</p><p>If you wish to use <code>TinyBasePartyKitServer</code> as a general PartyKit server, you can implement other methods. But you must remember to call the super implementations of those methods to ensure the <a href="/">TinyBase</a> synchronization stays supported in addition to your own custom functionality. The same applies to the constructor if you choose to implement that.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>TinyBasePartyKitServer<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-partykit-server'</span><span class="punctuation">;</span>

<span class="comment">// This is your PartyKit server entry point.</span>
<span class="keyword">export</span> <span class="keyword">class</span> <span class="class-name">MyServer</span> <span class="keyword">extends</span> <span class="class-name">TinyBasePartyKitServer</span> <span class="punctuation">{</span>
<span class="keyword">export</span> <span class="keyword">class</span> <span class="class-name">MyServer</span> <span class="keyword">extends</span> <span class="class-name"><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/">TinyBasePartyKitServer</a></span> <span class="punctuation">{</span>
<span class="function">constructor</span><span class="punctuation">(</span><span class="parameter">party</span><span class="punctuation">)</span> <span class="punctuation">{</span>
<span class="keyword">super</span><span class="punctuation">(</span>party<span class="punctuation">)</span><span class="punctuation">;</span>
<span class="comment">// custom constructor code</span>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
connection<span class="operator">:</span> Connection<span class="punctuation">,</span>
<span class="punctuation">)</span><span class="operator">:</span> <span class="builtin">Promise</span><span class="operator">&lt;</span><span class="keyword">void</span><span class="operator">></span></code></pre><div class="table"><table><tr><th></th><th>Type</th><th>Description</th></tr><tr><th><code>message</code></th><td><code><span class="builtin">string</span></code></td><td></td></tr><tr><th><code>connection</code></th><td><code>Connection</code></td><td></td></tr><tr><th class="right">returns</th><td><code><span class="builtin">Promise</span><span class="operator">&lt;</span><span class="keyword">void</span><span class="operator">></span></code></td><td><p></p></td></tr></table></div><p>If you choose to implement additional functionality in this method, you must remember to call the super implementation to ensure the <a href="/">TinyBase</a> synchronization stays supported.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>TinyBasePartyKitServer<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-partykit-server'</span><span class="punctuation">;</span>

<span class="keyword">export</span> <span class="keyword">class</span> <span class="class-name">MyServer</span> <span class="keyword">extends</span> <span class="class-name">TinyBasePartyKitServer</span> <span class="punctuation">{</span>
<span class="keyword">export</span> <span class="keyword">class</span> <span class="class-name">MyServer</span> <span class="keyword">extends</span> <span class="class-name"><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/">TinyBasePartyKitServer</a></span> <span class="punctuation">{</span>
<span class="keyword">async</span> <span class="function"><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onmessage/">onMessage</a></span><span class="punctuation">(</span><span class="parameter">message<span class="punctuation">,</span> connection</span><span class="punctuation">)</span> <span class="punctuation">{</span>
<span class="keyword">await</span> <span class="keyword">super</span><span class="punctuation">.</span><span class="function"><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onmessage/">onMessage</a></span><span class="punctuation">(</span>message<span class="punctuation">,</span> connection<span class="punctuation">)</span><span class="punctuation">;</span>
<span class="comment">// custom onMessage code</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
connection<span class="operator">:</span> Connection<span class="punctuation">,</span>
<span class="punctuation">)</span><span class="operator">:</span> <span class="builtin">Promise</span><span class="operator">&lt;</span><span class="keyword">void</span><span class="operator">></span></code></pre><div class="table"><table><tr><th></th><th>Type</th><th>Description</th></tr><tr><th><code>message</code></th><td><code><span class="builtin">string</span></code></td><td></td></tr><tr><th><code>connection</code></th><td><code>Connection</code></td><td></td></tr><tr><th class="right">returns</th><td><code><span class="builtin">Promise</span><span class="operator">&lt;</span><span class="keyword">void</span><span class="operator">></span></code></td><td><p></p></td></tr></table></div><p>If you choose to implement additional functionality in this method, you must remember to call the super implementation to ensure the <a href="/">TinyBase</a> synchronization stays supported.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>TinyBasePartyKitServer<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-partykit-server'</span><span class="punctuation">;</span>

<span class="keyword">export</span> <span class="keyword">class</span> <span class="class-name">MyServer</span> <span class="keyword">extends</span> <span class="class-name">TinyBasePartyKitServer</span> <span class="punctuation">{</span>
<span class="keyword">export</span> <span class="keyword">class</span> <span class="class-name">MyServer</span> <span class="keyword">extends</span> <span class="class-name"><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/">TinyBasePartyKitServer</a></span> <span class="punctuation">{</span>
<span class="keyword">async</span> <span class="function"><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onmessage/">onMessage</a></span><span class="punctuation">(</span><span class="parameter">message<span class="punctuation">,</span> connection</span><span class="punctuation">)</span> <span class="punctuation">{</span>
<span class="keyword">await</span> <span class="keyword">super</span><span class="punctuation">.</span><span class="function"><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onmessage/">onMessage</a></span><span class="punctuation">(</span>message<span class="punctuation">,</span> connection<span class="punctuation">)</span><span class="punctuation">;</span>
<span class="comment">// custom onMessage code</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nav><ul><li><a href="/">TinyBase</a></li><li><a href="/api/">API</a></li><li><a href="/api/persister-partykit-server/"><code>persister-partykit-server</code></a></li><li><a href="/api/persister-partykit-server/classes/">Classes</a></li><li><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/"><code>TinyBasePartyKitServer</code></a></li><li><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/">Methods</a></li><li><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/">Connection methods</a></li><li><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onrequest/"><code>onRequest</code></a></li></ul></nav><section class="s1" id="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onrequest/" data-id="oR"><h1><code>onRequest</code></h1><p>The <code>onRequest</code> method is called when a HTTP request is made to the party URL.</p><pre><code><span class="function"><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onrequest/">onRequest</a></span><span class="punctuation">(</span>request<span class="operator">:</span> Request<span class="punctuation">)</span><span class="operator">:</span> <span class="builtin">Promise</span><span class="operator">&lt;</span>Response<span class="operator">></span></code></pre><div class="table"><table><tr><th></th><th>Type</th><th>Description</th></tr><tr><th><code>request</code></th><td><code>Request</code></td><td></td></tr><tr><th class="right">returns</th><td><code><span class="builtin">Promise</span><span class="operator">&lt;</span>Response<span class="operator">></span></code></td><td><p></p></td></tr></table></div><p>If you choose to implement additional functionality in this method, you must remember to call the super implementation to ensure the <a href="/">TinyBase</a> synchronization stays supported.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>TinyBasePartyKitServer<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-partykit-server'</span><span class="punctuation">;</span>

<span class="keyword">export</span> <span class="keyword">class</span> <span class="class-name">MyServer</span> <span class="keyword">extends</span> <span class="class-name">TinyBasePartyKitServer</span> <span class="punctuation">{</span>
<span class="keyword">export</span> <span class="keyword">class</span> <span class="class-name">MyServer</span> <span class="keyword">extends</span> <span class="class-name"><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/">TinyBasePartyKitServer</a></span> <span class="punctuation">{</span>
<span class="keyword">async</span> <span class="function"><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onrequest/">onRequest</a></span><span class="punctuation">(</span><span class="parameter">request</span><span class="punctuation">)</span> <span class="punctuation">{</span>
<span class="comment">// custom onRequest code, else:</span>
<span class="keyword">return</span> <span class="keyword">await</span> <span class="keyword">super</span><span class="punctuation">.</span><span class="function"><a href="/api/persister-partykit-server/classes/server/tinybasepartykitserver/methods/connection/onrequest/">onRequest</a></span><span class="punctuation">(</span>request<span class="punctuation">)</span><span class="punctuation">;</span>
Expand Down
Loading

0 comments on commit 1991bae

Please sign in to comment.