-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(operator): add groupBy #166
Conversation
|
||
_next(value: T) { | ||
this.group.complete(); | ||
this.parent.groups[this.group.key] = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking here, but this logic seems ripe to put into a function on the GroupBySubscriber, the way we've done it in merge. This would also make it easier to subclass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable
There is a glaring bug in this one... if you select an object as a key. I'll need to rework this to add some sort of hash code or use an Array and lookup groups each time in the event that keys are objects. |
Made the desired changed for @trxcllnt ... I'm not going to change the "bug" I mentioned above though, keys should be returned as strings or they will coerce as strings because it's using a hashtable under the hood for group storage. I'm sticking with this method for performance reasons. Native Map implementations and Map shims are much, much slower on the look up. Given that performance is a primary goal, and that creating a composite key in the |
CompromiseAfter speaking with both @trxcllnt and @mattpodwysocki on this... I've come up with what I think is a solid compromise...
My tests have determined that Caveats
FutureI think this approach will enable us to easily remove the "FastMap" whenever ES6 Map is better optimized by more platforms. |
merged via rebase with 1e13aea |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
closes #165