Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matthme committed Oct 25, 2024
1 parent 7ff32cb commit f70b789
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/api-reference/api/api.parenttoappletmessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export type ParentToAppletMessage = {
} | {
type: 'peer-status-update';
payload: PeerStatusUpdate;
} | {
type: 'on-before-unload';
};
```
**References:** [WAL](./api.wal.md)<!-- -->, [RecordInfo](./api.recordinfo.md)<!-- -->, [PeerStatusUpdate](./api.peerstatusupdate.md)
Expand Down
17 changes: 17 additions & 0 deletions docs/api-reference/api/api.weaveclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,23 @@ Description
</td><td>
</td></tr>
<tr><td>
[onBeforeUnload](./api.weaveclient.onbeforeunload.md)
</td><td>
</td><td>
(callback: () =&gt; any) =&gt; [UnsubscribeFunction](./api.unsubscribefunction.md)
</td><td>
</td></tr>
<tr><td>
Expand Down
11 changes: 11 additions & 0 deletions docs/api-reference/api/api.weaveclient.onbeforeunload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@theweave/api](./api.md) &gt; [WeaveClient](./api.weaveclient.md) &gt; [onBeforeUnload](./api.weaveclient.onbeforeunload.md)

## WeaveClient.onBeforeUnload property

**Signature:**

```typescript
onBeforeUnload: (callback: () => any) => UnsubscribeFunction;
```
21 changes: 21 additions & 0 deletions docs/api-reference/api/api.weaveservices.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,27 @@ Gets the group permission type. May be used to restrict certain actions in the U
Sends notifications to We and depending on user settings and urgency level further to the operating system.


</td></tr>
<tr><td>

[onBeforeUnload](./api.weaveservices.onbeforeunload.md)


</td><td>


</td><td>

(callback: () =&gt; void) =&gt; [UnsubscribeFunction](./api.unsubscribefunction.md)


</td><td>

Event listener allowing to register a callback that will get executed before the applet gets reloaded, for example to save intermediate user input (e.g. commit the most recent changes of a document to the source chain).

If this callback takes too long, users may be offered to force reload, thereby ignoring/cancelling the pending callback.


</td></tr>
<tr><td>

Expand Down
15 changes: 15 additions & 0 deletions docs/api-reference/api/api.weaveservices.onbeforeunload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@theweave/api](./api.md) &gt; [WeaveServices](./api.weaveservices.md) &gt; [onBeforeUnload](./api.weaveservices.onbeforeunload.md)

## WeaveServices.onBeforeUnload property

Event listener allowing to register a callback that will get executed before the applet gets reloaded, for example to save intermediate user input (e.g. commit the most recent changes of a document to the source chain).

If this callback takes too long, users may be offered to force reload, thereby ignoring/cancelling the pending callback.

**Signature:**

```typescript
onBeforeUnload: (callback: () => void) => UnsubscribeFunction;
```
4 changes: 2 additions & 2 deletions docs/build/moss-sugar.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Now that the holochain app works outside Moss, let's add some Weave/Moss specifi
The Weave dev CLI will allow you to run yor Tool in a sandboxed instance of Moss with hot-reloading. Install it as a dev dependency:

```bash
npm install -d @theweave/[email protected]beta.6
npm install -d @theweave/[email protected]gamma.5
```

### Weave Client
Expand All @@ -19,5 +19,5 @@ npm install -d @theweave/[email protected]
The Weave API npm package will allow your Tool's frontend to interact with Moss using the `WeaveClient` class. Install it into the workspace of your frontend code:

```bash
npm install -w ui @theweave/api@0.1.0
npm install -w ui @theweave/api@0.2.1
```
1 change: 1 addition & 0 deletions example/ui/src/elements/wal-embed-debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
WeaveClient,
} from '@theweave/api';
import '@shoelace-style/shoelace/dist/components/spinner/spinner.js';
import '@shoelace-style/shoelace/dist/components/tooltip/tooltip.js';
import { appletOrigin, urlFromAppletHash } from '@theweave/elements';
import { sharedStyles, wrapPathInSvg } from '@holochain-open-dev/elements';
import { DnaHash, EntryHash } from '@holochain/client';
Expand Down

0 comments on commit f70b789

Please sign in to comment.