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

@loading 修饰过的方法不能 catch #3

Open
cncolder opened this issue Nov 27, 2019 · 5 comments
Open

@loading 修饰过的方法不能 catch #3

cncolder opened this issue Nov 27, 2019 · 5 comments

Comments

@cncolder
Copy link

虽然 catch 到异常了, 但是异常仍然被抛到了外面.

Uncaught (in promise) Error: test

class MyStore {
  @loading async load() {
    throw new Error('test')
  }
}

(async () => {
  try {
    await new MyStore().load()
  } catch (err) {
    console.log(err.message)
  }
})()
@DiamondYuan
Copy link

class Test {
  @loading
  func = () => {};
}

现在的 mobx-loading 支持箭头函数吗?

@niqingyang
Copy link
Owner

class Test {
  @loading
  func = () => {};
}

现在的 mobx-loading 支持箭头函数吗?

支持的

@DiamondYuan
Copy link

class Test {
  @loading
  func = () => {};
}

现在的 mobx-loading 支持箭头函数吗?

支持的

这里没实现。应该是不支持的把。

@DiamondYuan
Copy link

用 typescript 的时候 descriptor 为 undefined

@DiamondYuan
Copy link

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