-
Notifications
You must be signed in to change notification settings - Fork 58
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
support adding fewer than numItems via auto-trim() #44
Open
leeoniya
wants to merge
8
commits into
mourner:main
Choose a base branch
from
leeoniya:leeoniya/trim
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
740a981
bump devdeps
leeoniya e58b06b
move constructor body to an init() helper
leeoniya 76b2944
add auto-trim to finish()
leeoniya f60e558
move FlatQueue init to finish()
leeoniya dacca3e
bump devdeps
leeoniya 9d64e49
esm build, bump devdeps
leeoniya 11830cc
wip
leeoniya 239880b
Merge branch 'leeoniya/trim2' into leeoniya/trim
leeoniya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this causes TS to be confused now about initializing various
this.*
things it expects to see in the constructor, not sure how to fix it.honestly, i think having Flatbush and FlatQueue be ES6 classes does not help here. there's really no reason for either to be a class instead of a plain closure (which can still be used just fine with
new
or without. havingconstructor
be special is problematic because it cannot be invoked withoutnew
like you can do with a plain init function. i dont think the polymorphism afforded by classes adds anything to this lib.related discussion about "resetting" already-allocated class instances: https://stackoverflow.com/questions/47917721/pooling-with-javascript-classes
if you're interested, i can port Flatbush to TS and a closure fn instead of a class.