Skip to content
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

refactor(timeInterval): implement in terms of scan #3177

Merged
merged 1 commit into from
Mar 30, 2018

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented Dec 8, 2017

reducing the size of timeInterval. A non-hotpath operator.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.005%) to 97.075% when pulling 826b6a6 on benlesh:smaller-timeInterval into efcd922 on ReactiveX:master.

({ current }, value) => ({ value, current: scheduler.now(), last: current }),
{ current: scheduler.now() }
) as any,
map(({ current, last, value }) => new TimeInterval(value, current - last)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: will there be difference if we just map to object instead of class?

interface TimeInterval<T> {
readonly value: T;
readonly interval: number
}

....
map<TimeInterval>((...) => ({value, interval: current - last}));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. There's probably some negligible perf benefit to it being a class, butt I'm speculating I can change it. It'll probably further reduce size

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't lose anything (and I'm pretty sure transpiled sizewise object will be smaller than class) I'd like to suggest to go for object, as TimeInterval class really doesn't nothing in here.

@benlesh
Copy link
Member Author

benlesh commented Mar 30, 2018

@kwonoj, I could not remove the class just yet, because it's being exported for backwards compat reasons. We'll remove it soon.

@benlesh benlesh merged commit 23566af into ReactiveX:master Mar 30, 2018
@lock
Copy link

lock bot commented Jun 5, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants