Skip to main content

Target

@rotorsoft/act-root


@rotorsoft/act-root / act/src / Target

Type Alias: Target<TActor>

Target<TActor> = object

Defined in: libs/act/src/types/action.ts:69

Target specification for action execution.

Identifies which state instance (stream) should process the action and who is performing it. The target combines the stream identifier with actor context for complete audit trail.

Examples

const target: Target = {
stream: "user-123",
actor: { id: "admin", name: "Admin User" }
};

await app.do("updateProfile", target, { email: "new@example.com" });
const userId = "user-" + Date.now();
await app.do("createUser", {
stream: userId,
actor: currentUser
}, userData);

Type Parameters

TActor

TActor extends Actor = Actor

Actor type extending base Actor (default: Actor)

Properties

actor

readonly actor: TActor

Defined in: libs/act/src/types/action.ts:71


expectedVersion?

readonly optional expectedVersion: number

Defined in: libs/act/src/types/action.ts:72


stream

readonly stream: string

Defined in: libs/act/src/types/action.ts:70