Skip to content

Commit

Permalink
resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Sep 17, 2024
2 parents b61deee + aa58422 commit ad88f67
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ _untested_
const tags = [ "#t", "introduction"]
const pubkey = "e771af0b05c8e95fcdf6feb3500544d2fb1ccd384788e9f490bb3ee28e8ed66f"

//set options for miner
//set options for notemine
const difficulty = 21
const numberOfWorkers = 7

Expand All @@ -56,7 +56,7 @@ _untested_
//you can also set content, tags and pubkey via assessors after initialization.
notemine.pubkey = pubkey

//start miner
//start notemine
notemine.mine()
```

Expand All @@ -77,15 +77,15 @@ notemine.success$
<script lang="ts">
import { onMount } from 'svelte';
import { type Writable, writable } from 'svelte/store'
import { type ProgressEvent, NostrMiner } from 'nostr-miner';
import { type ProgressEvent, Notemine } from 'notemine';
const numberOfMiners = 8
let miner: NostrMiner;
let notemine: Notemine;
let progress: Writable<ProgressEvent[]> = new writable(new Array(numberOfMiners))
let success: Writeable<SuccessEvent> = new writable(null)
onMount(() => {
miner = new NostrMiner({ content: 'Hello, Nostr!', numberOfMiners });
notemine = new Notemine({ content: 'Hello, Nostr!', numberOfMiners });
const progress$ = miner.progress$.subscribe(progress_ => {
progress.update( _progress => {
Expand All @@ -103,7 +103,7 @@ notemine.success$
miner.cancel();
});
miner.mine();
notemine.mine();
return () => {
progress$.unsubscribe();
Expand Down Expand Up @@ -137,21 +137,21 @@ notemine.success$

```reactjs
import React, { useEffect } from 'react';
import { NostrMiner } from 'nostr-miner';
import { Notemine } from 'notemine';
const MyComponent = () => {
const miner = new NostrMiner({ content: 'Hello, Nostr!' });
const notemine = new Notemine({ content: 'Hello, Nostr!' });
useEffect(() => {
const subscription = miner.progress$.subscribe(progress => {
// Update progress bar or display miner's progress
const subscription = notemine.progress$.subscribe(progress => {
// Update progress bar or display notemine's progress
});
miner.mine();
notemine.mine();
return () => {
subscription.unsubscribe();
miner.cancel();
notemine.cancel();
};
}, []);
Expand All @@ -177,23 +177,23 @@ notemine.success$
<script lang="ts">
import { defineComponent, onMounted, onUnmounted } from 'vue';
import { NostrMiner } from 'nostr-miner';
import { Notemine } from 'notemine';
export default defineComponent({
name: 'MinerComponent',
setup() {
const miner = new NostrMiner({ content: 'Hello, Nostr!' });
const notemine = new Notemine({ content: 'Hello, Nostr!' });
onMounted(() => {
const subscription = miner.progress$.subscribe(progress => {
// Update progress bar or display miner's progress
const subscription = notemine.progress$.subscribe(progress => {
// Update progress bar or display notemine's progress
});
miner.mine();
notemine.mine();
onUnmounted(() => {
subscription.unsubscribe();
miner.cancel();
notemine.cancel();
});
});
Expand All @@ -210,29 +210,29 @@ export default defineComponent({

```javascript
import { Component, OnInit, OnDestroy } from '@angular/core';
import { NostrMiner } from 'nostr-miner';
import { Notemine } from 'notemine';
import { Subscription } from 'rxjs';

@Component({
selector: 'app-miner',
templateUrl: './miner.component.html',
selector: 'app-notemine',
templateUrl: './notemine.component.html',
})
export class MinerComponent implements OnInit, OnDestroy {
miner: NostrMiner;
notemine: Notemine;
progressSubscription: Subscription;

ngOnInit() {
this.miner = new NostrMiner({ content: 'Hello, Nostr!' });
this.progressSubscription = this.miner.progress$.subscribe(progress => {
// Update progress bar or display miner's progress
this.notemine = new Notemine({ content: 'Hello, Nostr!' });
this.progressSubscription = this.notemine.progress$.subscribe(progress => {
// Update progress bar or display notemine's progress
});

this.miner.mine();
this.notemine.mine();
}

ngOnDestroy() {
this.progressSubscription.unsubscribe();
this.miner.cancel();
this.notemine.cancel();
}
}
```
Expand Down

0 comments on commit ad88f67

Please sign in to comment.