Skip to content
This repository was archived by the owner on Oct 28, 2022. It is now read-only.

Commit 56de435

Browse files
committed
::doc: : update doc
1 parent bb28ba0 commit 56de435

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ npm install vue @nopr3d/vue-next-rx rxjs --save
4040

4141
```js
4242
import Vue from "vue";
43-
import VueRx from "@nopr3d/vue-next-rx";
43+
import VueNextRx from "@nopr3d/vue-next-rx";
4444

45-
Vue.use(VueRx);
45+
Vue.use(VueNextRx);
4646
```
4747

4848
<br />
@@ -57,6 +57,24 @@ Example:
5757
<script src="https://unpkg.com/rxjs@^7/dist/bundles/rxjs.umd.min.js"></script>
5858
<script src="https://unpkg.com/vue@next"></script>
5959
<script src="../dist/vue-next-rx.js"></script>
60+
<div id="app">
61+
<div class="home">
62+
<button v-stream:click="click$">Click Me</button>
63+
</div>
64+
</div>
65+
<script>
66+
const { Subject, Observable, BehaviorSubject } = rxjs;
67+
const { map, startWith, scan } = rxjs.operators;
68+
const { ref, watch } = VueNextRx; // Use VueNextRx
69+
70+
const app = Vue.createApp({
71+
domStreams: ["click$"],
72+
subscriptions() {
73+
this.click$.pipe(map(() => "Click Event")).subscribe(console.log); // On click will print "Click Event"
74+
},
75+
}).use(VueNextRx);
76+
app.mount("#app");
77+
</script>
6078
```
6179

6280
<br />
@@ -238,7 +256,7 @@ export default defineComponent({
238256
239257
## `$subscribeTo(observable, next, error, complete)`
240258
241-
This is a prototype method added to instances. You can use it to subscribe to an observable, but let VueRx manage the dispose/unsubscribe.
259+
This is a prototype method added to instances. You can use it to subscribe to an observable, but let VueNextRx manage the dispose/unsubscribe.
242260
243261
```js
244262
import { interval } from "rxjs";

0 commit comments

Comments
 (0)