-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage with Class based component #71
Comments
@psyCodelist
|
This should be work with vue-calss-component |
I want to found this solution.. but i don't find that. https://github.com/MinuKang/vue-rx-decorators |
Via the
|
Are there any options to use subscriptions with TypeScript? |
I've found out that in case of TypeScript the following code works:
|
@dmdnkv Did you have the same issue and did you manage to solve it ? |
@lambda0xff |
I wonder if @MinUKang decorators can be incorporated into Vue-RX |
@lambda0xff
because it covers vue.d.ts, see(vue-rx/types/index.d.ts): import Vue from 'vue'
import { WatchOptions } from 'vue'
import { Observable } from 'rxjs'
export type Observables = Record<string, Observable<any>>
declare module 'vue/types/options' {
interface ComponentOptions<V extends Vue> {
subscriptions?: Observables | ((this: V) => Observables)
domStreams?: string[]
observableMethods?: string[] | Record<string, string>
}
}
export interface WatchObservable<T> {
newValue: T
oldValue: T
}
declare module "vue/types/vue" {
interface Vue {
$observables: Observables;
$watchAsObservable(expr: string, options?: WatchOptions): Observable<WatchObservable<any>>
$watchAsObservable<T>(fn: (this: this) => T, options?: WatchOptions): Observable<WatchObservable<T>>
$eventToObservable(event: string): Observable<{name: string, msg: any}>
$subscribeTo<T>(
observable: Observable<T>,
next: (t: T) => void,
error?: (e: any) => void,
complete?: () => void): void
$fromDOMEvent(selector: string | null, event: string): Observable<Event>
$createObservableMethod(methodName: string): Observable<any>
}
}
export default function VueRx(V: typeof Vue): void |
Hello,
Is there any place that I can see example of integration with Class Based Components?
Many thanks in advance!
The text was updated successfully, but these errors were encountered: