wait
waitは指定した時間だけ処理を待機する関数です。
基本的な使い方
import { wait, executeAction } from "@basemachina/action";
 
/** @type { import("@basemachina/action").Handler } */
export default async ({ emails }) => {
  for (const email of emails) {
    //  DBにユーザーのデータを作成するアクションを実行
    await executeAction("create-user", { email });
 
    // DBの負荷を下げるために1秒待機
    await wait(1000);
  }
 
  return "ユーザーを作成しました";
};詳細なインターフェース
引数
| 引数名 | 型 | 説明 | 例 | 
|---|---|---|---|
| milliseconds | number | 待機する時間をミリ秒で指定します。 | 1000 | 
戻り値
戻り値はありません。