44 lines
1.0 KiB
TypeScript
44 lines
1.0 KiB
TypeScript
import { type } from '@ngrx/signals';
|
|
import { eventGroup } from '@ngrx/signals/events';
|
|
import {
|
|
BoardColumn,
|
|
BoardFilter,
|
|
CommandResult,
|
|
CreateIssueInput,
|
|
IssueChanged,
|
|
IssueStatus,
|
|
} from '@task-stream/web/tracker/domain';
|
|
|
|
export const boardPageEvents = eventGroup({
|
|
source: 'Board Page',
|
|
events: {
|
|
opened: type<BoardFilter>(),
|
|
filterChanged: type<BoardFilter>(),
|
|
/** Optimistic: the card moves immediately and comes back if the API refuses. */
|
|
issueMoved: type<{
|
|
issueId: string;
|
|
to: IssueStatus;
|
|
reason?: string | null;
|
|
}>(),
|
|
issueCreateRequested: type<CreateIssueInput>(),
|
|
},
|
|
});
|
|
|
|
export const boardApiEvents = eventGroup({
|
|
source: 'Board API',
|
|
events: {
|
|
loaded: type<BoardColumn[]>(),
|
|
loadFailed: type<string>(),
|
|
issueMoveFailed: type<string>(),
|
|
issueCreated: type<CommandResult>(),
|
|
issueCreateFailed: type<string>(),
|
|
},
|
|
});
|
|
|
|
export const boardRealtimeEvents = eventGroup({
|
|
source: 'Board Realtime',
|
|
events: {
|
|
issueChanged: type<IssueChanged>(),
|
|
},
|
|
});
|