Live data from Hacker News

Viewing profile — musicq

musicq

HN member
Joined
Thu, Mar 26, 2020, 8:27 PM UTC
HN karma
23
Public activity
12 items

About musicq

No profile information was provided.

Recent public activity

  1. comment
    Comment #38083238

    Thank you for the suggestion! I will add that.

  2. comment
    Comment #38083222

    I think the most usual way in a project is to use this style. Wrap is a simple way to let you get Result type without refactoring your implementation. https://musicq.gitbook.io/unw…

  3. comment
    Comment #38083209

    try/catch has no problem, but the premise is that you know there will be errors been thrown. Say a function `divide`, you can barely tell that whether it will throw errors or not w…

  4. comment
    Comment #38083152

    The thing is not using try/catch, like the first case, sometimes you don't know if a function will throw or not. You can't tell from the function signature as well. So this provide…

  5. comment
    Comment #38082956

    This library provides a way to encapsulate errors into a Result type, so that any user want to retrieve the value, they must unwrap the Result first. In this way I think it will fo…

  6. comment
    Comment #38082578

    Don't think would affect performance. The core function `wrap` is just try catch under the hood. https://github.com/musicq/unwrapit/blob/d5c437a235ad1f5ad042...

  7. comment
    Comment #38082471

    Actually rxjs is a `peerDependency` which means it will assume the user will have it installed already.

  8. comment
    Comment #38080689

    Spent sometime to complete the document of my rust Result like library `unwrapit` for JS/TS. Still think this might be a proper way to deal with errors in JS/TS

  9. story
  10. comment
  11. comment
    Comment #35199839

    Use Rust Result types in TypeScript to handle errors easier in both sync/async functions.

  12. story