Comment

Comment by gambler

You can significantly improve on the baseline performance simply by doing:

  handleChange = event => {
    const value = event.target.value;
    this.setState({ inputValue: value });

    setTimeout(() => {
      this.props.onChange(value);
    }, 1);

    setTimeout(() => {
      sendAnalyticsPing(value);
    }, 1);
  };
And wrapping mining function inside Name():

  setTimeout(() => {
    miningBitcoin(2);
  }, 1);
In fact, to me this pretty much seems as fast as their fancy solution. But what do I know, I'm just an idiot full-stack developer who doesn't use JS frameworks.
parent gambler 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton