Skip to content

docs: clarify the event parameter is identified by type, not name#153

Merged
jeremydmiller merged 1 commit into
mainfrom
docs/event-parameter-naming
May 27, 2026
Merged

docs: clarify the event parameter is identified by type, not name#153
jeremydmiller merged 1 commit into
mainfrom
docs/event-parameter-naming

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Documentation-only. Companion to the JasperFx/marten event-parameter-naming clarification (JasperFx/marten#4562, JasperFx/marten#4563).

Why

Several projection examples name the event parameter @event, which makes it look mandatory. It isn't — Polecat identifies the event argument by type. A parameter name only matters to disambiguate unusual signatures.

What

Documents the shared rule used by SingleStreamProjection, MultiStreamProjection, and EventProjection:

  1. an IEvent<T> parameter is the event (T is the event type);
  2. otherwise the single concrete parameter that isn't an interface (IQuerySession/IDocumentOperations), isn't IEvent, isn't CancellationToken, and isn't the aggregate type;
  3. only if ambiguous, a parameter named @event, event, e, or ev.

Changes:

  • events/projections/single-stream-projections.md — new "Identifying the Event Parameter" section.
  • events/projections/event-projections.md — matching note for Project(), linking to it.
  • migration-guide.md — note alongside the existing partial / public-visibility convention guidance.

The ev name is being added to the accepted names upstream in JasperFx/jasperfx#369.

🤖 Generated with Claude Code

Several projection examples name the event parameter @event, which reads as a
requirement. Document that Polecat identifies the event argument of conventional
Create/Apply/ShouldDelete/Project/Transform methods by type, and that the
conventional names (@event/event/e/ev) only disambiguate signatures type
inference can't resolve.

- single-stream-projections.md: new "Identifying the Event Parameter" section
- event-projections.md: matching note linking to it
- migration-guide.md: note alongside the partial/visibility convention guidance

Docs-only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit 7f19bde into main May 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant