logo

rvp

The rvp function stands for return void promise. It takes a function and returns a promise that resolves to nothing.

import { rvp } from '@aracna/core';

(async () => {
  async function add(a, b) {
    return a + b;
  }

  // will log undefined
  console.log(await rvp(() => add(1, 2)));
})();