Conversation
🦋 Changeset detectedLatest commit: 03fb5d1 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| expect(accumulatorSpy).toHaveBeenNthCalledWith(3, undefined, 3, 2); | ||
| expect(accumulatorSpy).toHaveBeenCalledTimes(2); | ||
| expect(accumulatorSpy).toHaveBeenNthCalledWith(1, 1, 2, 1); | ||
| expect(accumulatorSpy).toHaveBeenNthCalledWith(2, undefined, 3, 2); |
There was a problem hiding this comment.
In the no-seed scenario for reduce, the accumulator should use the result of the prior accumulation rather than 'undefined' as the first argument on subsequent calls. Please review the reduce operator implementation to ensure its behavior aligns with Array.prototype.reduce.
| expect(accumulatorSpy).toHaveBeenNthCalledWith(2, undefined, 3, 2); | |
| expect(accumulatorSpy).toHaveBeenNthCalledWith(2, 3, 3, 2); |
There was a problem hiding this comment.
The accumulator function intentionally returns undefined (as apart of the test case). The second call to the accumulator fn should have undefined as its acc value since that was what was returned by the last one, so this should be a non issue.
This introduces 10 new utility operators into eventkit. Most of them are additions that pair with the recently landed singleton observables.
Also fixes the behavior of the reduce operator so that it more closely matches up with it's Array.prototype.reduce counterpart