Skip to content
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

When I click on the jump, I will report the error. #6

Open
pangshangggg opened this issue Mar 14, 2018 · 4 comments
Open

When I click on the jump, I will report the error. #6

pangshangggg opened this issue Mar 14, 2018 · 4 comments

Comments

@pangshangggg
Copy link

formSubmit:()=>{
rxwx.navigateTo({url: '../setTask/setTask'})
.debounce(1000)
.subscribe()
}
error:Rx.js:8064 Uncaught (in promise) TypeError: this.durationSelector.call is not a function
at DebounceSubscriber._next (Rx.js:8064)
at DebounceSubscriber.Subscriber.next (Rx.js:631)
at RxWX.js? [sm]:14
at

@yalishizhude
Copy link
Owner

Operator "debounce" is used incorrectly.

An available solution:

import rxwx, { Rx } from '../../util/RxWX.js';
Page({
  navigate: new Rx.Subject(),
  onReady() {
    Rx.Observable.of().multicast(this.navigate)
      .debounceTime(1000)
      .switchMap(url => rxwx.navigateTo({
        url
      }))
      .subscribe()
  },
  open(e) {
    this.navigate.next('../setTask/setTask')
  }
});

@pangshangggg
Copy link
Author

thirdScriptError
Cannot read property 'subscribe' of undefined;at pages/main/main page lifeCycleMethod onReady function
TypeError: Cannot read property 'subscribe' of undefined
at EmptyObservable.ConnectableObservable._subscribe (http://127.0.0.1:58478/appservice/utils/Rx.js:10899:33)
at EmptyObservable.Observable.subscribe (http://127.0.0.1:58478/appservice/utils/Rx.js:685:41)
at DebounceTimeOperator.call (http://127.0.0.1:58478/appservice/utils/Rx.js:7859:23)
at Observable.subscribe (http://127.0.0.1:58478/appservice/utils/Rx.js:682:22)
at SwitchMapOperator.call (http://127.0.0.1:58478/appservice/utils/Rx.js:13103:23)
at Observable.subscribe (http://127.0.0.1:58478/appservice/utils/Rx.js:682:22)
at e.onReady (http://127.0.0.1:58478/appservice/pages/main/main.js:53:8)
at e. (http://127.0.0.1:58478/appservice/__dev__/WAService.js:17:25368)
at J (http://127.0.0.1:58478/appservice/__dev__/WAService.js:17:14633)
at Function. (http://127.0.0.1:58478/appservice/__dev__/WAService.js:17:16796)

@yalishizhude
Copy link
Owner

@pangshangggg Please show me your code~

@TravisXie
Copy link

@pangshangggg because U R using the wrong operator,
Using debounceTime will fix it and do the job~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants