Skip to main content
This release is 0 versions behind 24.6.2 — the latest version of @rivet-gg/actor-client. Jump to latest

🔧 Rivet Actors have built-in RPC, state, and events — the easiest way to build modern applications.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
70%
Published
a month ago (24.6.2-rc.2)
method ActorHandleRaw.prototype.once
ActorHandleRaw.prototype.once<Args extends Array<unknown> = unknown[]>(
eventName: string,
callback: (...args: Args) => void,
): EventUnsubscribe

Subscribes to an event that will be triggered only once.

Type Parameters

Args extends Array<unknown> = unknown[]
  • The type of arguments the event callback will receive.

Parameters

eventName: string
  • The name of the event to subscribe to.
callback: (...args: Args) => void
  • The callback function to execute when the event is triggered.

Return Type

  • A function to unsubscribe from the event.

See

Add Package

deno add jsr:@rivet-gg/actor-client

Import symbol

import { ActorHandleRaw } from "@rivet-gg/actor-client";

---- OR ----

Import directly with a jsr specifier

import { ActorHandleRaw } from "jsr:@rivet-gg/actor-client";

Add Package

npx jsr add @rivet-gg/actor-client

Import symbol

import { ActorHandleRaw } from "@rivet-gg/actor-client";

Add Package

yarn dlx jsr add @rivet-gg/actor-client

Import symbol

import { ActorHandleRaw } from "@rivet-gg/actor-client";

Add Package

pnpm dlx jsr add @rivet-gg/actor-client

Import symbol

import { ActorHandleRaw } from "@rivet-gg/actor-client";

Add Package

bunx jsr add @rivet-gg/actor-client

Import symbol

import { ActorHandleRaw } from "@rivet-gg/actor-client";