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:71

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:73


expectedVersion?โ€‹

readonly optional expectedVersion?: number

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


streamโ€‹

readonly stream: string

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