Git Product home page Git Product logo

Comments (6)

yyx990803 avatar yyx990803 commented on July 4, 2024 2

released 2.0.0.

from vue-rx.

zoomclub avatar zoomclub commented on July 4, 2024

I'm not sure why RxJS has to be integrated in such a cloaked way by Vue (is there some benefit I'm not aware of)? RxJS is what it is, just another API, a utility that can be imported and used where it and it's wonderful operators might find a usage.

Integrating RxJS as a Vue Directive would be better. Then in the directives handler you can use RxJS to it's maximum benefit. I just saw the following awesome article where the Pointer-Events API was integrated into Vue via a Directive. The same integration could be done for RxJS.

https://benjaminlistwon.com/blog/strategies-for-extending-vue

The RxJS API should be just like Lodash or any other API, just an option one is free to use in component method, computed or watch functions.

from vue-rx.

beeplin avatar beeplin commented on July 4, 2024

@zoomclub RxJS may be used to handle either DOM events or back-end socket.io data push. If you are using Vue, I don't think RxJS is quite useful for DOM handling, since Vue (as a view tool) already has plenty of gadgets to interact with the DOM. But Vue doesn't provide any model or back-end data tools. That's where RxJS can help. I usually use this plugin to link socket.io data push from back-end and vue in the front-end.

from vue-rx.

zoomclub avatar zoomclub commented on July 4, 2024

@beeplin Still need a way to turn DOM events into a stream/observable in Vue component template. A directive would essentially just wrap the following RxJS operator:

http://reactivex.io/rxjs/class/es6/Observable.js~Observable.html#static-method-fromEvent

<div v-rxjs:event-type=โ€œhandlerโ€> would be nice, because RxJS offers something unique.

from vue-rx.

yyx990803 avatar yyx990803 commented on July 4, 2024

I think it might be better if we change the API to use a separate option instead:

data () {
  // normal state
  return { ... }
},
rx: {
  key: someObservable$
},

This more explicitly separates observables vs. normal state, and solves the issue you are running into.

from vue-rx.

beeplin avatar beeplin commented on July 4, 2024

@yyx990803 sure, that would be great. :)

from vue-rx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.