Comment

Comment by jlhawn

In the "Use as a `do` expression" section, the example which uses `run` does not need the `else` cases and could be simplified:

  function doWork() {
    const x = run(() => {
      if (foo()) return f();
      if (bar()) return g();
      return h();
    });
  
    return x * 10;
  }
parent jlhawn 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton