Skip to content

Commit

Permalink
update @notemine/wrapper README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Oct 28, 2024
1 parent a2cb4b7 commit b549107
Showing 1 changed file with 12 additions and 43 deletions.
55 changes: 12 additions & 43 deletions packages/wrapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,22 @@ _untested_
notemine.mine()
```

Updates to notemine can be accessed via observables.
Mining updates can be accessed via observables.

```
notemine.progress$
notemine.error$
notemine.cancelled$
notemine.success$
```

for example:

```
miner.progress$.subscribe( progress => {
console.log(progress.workerId, progress)
});
```

<details>
<summary>svelte</summary>
Expand All @@ -79,7 +86,6 @@ notemine.success$
import { type Writable, writable } from 'svelte/store';
import { type ProgressEvent, Notemine } from '@notemine/wrapper';
const numberOfMiners = 8
let notemine: Notemine;
let progress: Writable<ProgressEvent[]> = new writable(new Array(numberOfMiners))
Expand Down Expand Up @@ -239,41 +245,8 @@ export class MinerComponent implements OnInit, OnDestroy {
```
</details>

## build
The wasm is not included in version control, so to build you'll need rust and it's toolchain. That includes `rustup` and `cargo`

### install build deps

Install **wasm-pack** with `cargo install wasm-pack`

### build wasm
Build the wasm with `build:wasm`

**npm**

```bash
npm build:wasm
```

<details>
<summary>pnpm</summary>

```bash
pnpm build:wasm
```
</details>

<details>
<summary>yarn</summary>
### build

```bash
yarn build:wasm
```
</details>

### build package

Build the package with `build`
**npm**

```bash
Expand All @@ -297,26 +270,22 @@ Build the package with `build`
</details>

### test
<details>
<summary>npm</summary>

```bash
npm run build
npm run test
```
</details>

<details>
<summary>pnpm</summary>

```bash
pnpm run build
pnpm run test
```
</details>

<details>
<summary>yarn</summary>

```bash
yarn build
yarn test
```
</details>

0 comments on commit b549107

Please sign in to comment.