first commit
This commit is contained in:
43
libs/web/tracker/application/src/lib/events/board.events.ts
Normal file
43
libs/web/tracker/application/src/lib/events/board.events.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
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>(),
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user