Maybe allow creating a projection in this style that also creates a subscription under the hood?
function IsUsernameClaimedProjection(username) {
return createProjection({
initialState: false,
handlers: {
AccountRegistered: (state, event) => true,
AccountClosed: (state, event) => false,
UsernameChanged: (state, event) => event.data.newUsername === username,
},
tagFilter: [`username:${username}`],
})
}
Maybe allow creating a projection in this style that also creates a subscription under the hood?