From b549107618c96cb47150f37223de94e44b09c4ae Mon Sep 17 00:00:00 2001 From: dskvr Date: Mon, 28 Oct 2024 18:53:21 +0100 Subject: [PATCH] update @notemine/wrapper README.md --- packages/wrapper/README.md | 55 +++++++++----------------------------- 1 file changed, 12 insertions(+), 43 deletions(-) diff --git a/packages/wrapper/README.md b/packages/wrapper/README.md index 14cb0c7..2c0343f 100644 --- a/packages/wrapper/README.md +++ b/packages/wrapper/README.md @@ -60,7 +60,8 @@ _untested_ notemine.mine() ``` -Updates to notemine can be accessed via observables. +Mining updates can be accessed via observables. + ``` notemine.progress$ notemine.error$ @@ -68,7 +69,13 @@ notemine.cancelled$ notemine.success$ ``` +for example: +``` +miner.progress$.subscribe( progress => { + console.log(progress.workerId, progress) +}); +```
svelte @@ -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 = new writable(new Array(numberOfMiners)) @@ -239,41 +245,8 @@ export class MinerComponent implements OnInit, OnDestroy { ```
-## 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 -``` - -
-pnpm - -```bash - pnpm build:wasm -``` -
- -
-yarn +### build -```bash - yarn build:wasm -``` -
- -### build package - -Build the package with `build` **npm** ```bash @@ -297,19 +270,15 @@ Build the package with `build` ### test -
-npm - ```bash - npm run build + npm run test ``` -
pnpm ```bash - pnpm run build + pnpm run test ```
@@ -317,6 +286,6 @@ Build the package with `build` yarn ```bash - yarn build + yarn test ```