New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@jogit/tmp-actor

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jogit/tmp-actor

latest
npmnpm
Version
24.6.2-rc.13
Version published
Maintainers
1
Created
Source

Rivet Actor

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

Getting Started

  • Setup Guide
  • Documentation
  • Examples

Usage

Make sure you've installed the Rivet CLI.

# Create project
rivet init

# Deploy actor
rivet deploy

See the setup guide for more information.

Example

import { Actor } from "@rivet-gg/actor";
import type { Rpc } from "@rivet-gg/actor";

// Durable state for the counter (https://rivet.gg/docs/state)
interface State {
	count: number;
}

export default class Counter extends Actor<State> {
	// Create the initial state when the actor is first created (https://rivet.gg/docs/state)
	override _onInitialize(): State {
		return { count: 0 };
	}

	// Listen for state changes (https://rivet.gg/docs/lifecycle)
	override _onStateChange(newState: State): void | Promise<void> {
		// Broadcast a state update event to all clients (https://rivet.gg/docs/events)
		this._broadcast("count", newState.count);
	}

	// Expose a remote procedure call for clients to update the count (https://rivet.gg/docs/rpc)
	increment(_rpc: Rpc<Counter>, count: number): number {
		this._state.count += count;
		return this._state.count;
	}
}

Community & Support

License

Apache 2.0

FAQs

Package last updated on 16 Jan 2025

Related posts