-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add indexers that allow to create ad-hoc indexes #140
Conversation
👉 View analysis in DeepCode’s Dashboard | Configure the bot |
After writing down the PR message, this whole change sounds rather edge-casey and introduces a whole new stream definition API into the EventStore and Storage layers. Also, that API does some clever (bad) stuff internally ( For the example of event type streams, the existing solution is only two lines of code and not really complicated. For the case that the matching is indeed more complicated, I'm not sure it is worth adding this API surface. Especially since an actual projection API with |
# Conflicts: # src/Storage/WritableStorage.js
Closing this for now for the reasons given above. |
Sometimes it is necessary to iterate all events that fulfill a specific condition, which is not known at design time. A (suboptimal) example is events by type that are coming in from another system.
For those cases it was not possible to create on-the-fly streams easily and required code like this:
For more complicated event matching that requires a matcher function, the function would have needed to be stringified and evaluated, so that variables from the incoming event are serialized into the matcher function, as that needs to be pure.
With this change the same can be achieved like that: