@@ -40,9 +40,9 @@ npm install vue @nopr3d/vue-next-rx rxjs --save
40
40
41
41
``` js
42
42
import Vue from " vue" ;
43
- import VueRx from " @nopr3d/vue-next-rx" ;
43
+ import VueNextRx from " @nopr3d/vue-next-rx" ;
44
44
45
- Vue .use (VueRx );
45
+ Vue .use (VueNextRx );
46
46
```
47
47
48
48
<br />
@@ -57,6 +57,24 @@ Example:
57
57
<script src =" https://unpkg.com/rxjs@^7/dist/bundles/rxjs.umd.min.js" ></script >
58
58
<script src =" https://unpkg.com/vue@next" ></script >
59
59
<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 >
60
78
```
61
79
62
80
<br />
@@ -238,7 +256,7 @@ export default defineComponent({
238
256
239
257
## ` $subscribeTo (observable, next, error, complete)`
240
258
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.
242
260
243
261
` ` ` js
244
262
import { interval } from " rxjs" ;
0 commit comments