TypeError: You provided 'undefined' where a stream was expected

前端 未结 10 669
广开言路
广开言路 2021-01-11 09:42

I have an Ionic app that has a user provider with a signup() method:

doSignup() {
  // set         


        
10条回答
  •  生来不讨喜
    2021-01-11 10:06

    I had the same error and typical scenario was that I was returning different actions based on certain condition. But handling of one condition was missing and I was not returning anything under my effects. That's when this issue came up. It's always better to have a default return action to avoid such instances.

    ...mergeMap((res: FetchWorkflowStatusResponse) => {
       if(this){
          return action1
       } else if(that){
          return action2
       }
    }
    

    Now if some value other than this and that comes then there will not be any return statement and the error will be thrown.

提交回复
热议问题