Comments (3)
const sorted = new SortedArray(...array)
Just use the constructor, it doesn't trigger sorting.
EDIT:
Is that the preferred solution?
Yes, at least for now, I have to test how much/and if spreading adds overhead and whether it's worth having a special logic for this situation.
from structurae.
I heavily use web workers for short bursts of computation,
I could use the native array methods, but the methods in this library are quite useful 😄 to pass up. Thanks for the library.
from structurae.
Looks like you could do.
new SortedArray(...[10,9])`
Is that the preferred solution?
from structurae.
Related Issues (20)
- Storing graph nodes HOT 2
- Benchmark not ablet to run HOT 1
- TypedArray storing js object? HOT 1
- Types Issue? HOT 1
- Sorted ObjectView? HOT 1
- SharedArrayBuffer support? HOT 6
- Benchmark results HOT 1
- Documentation: BinaryHeap.compare HOT 1
- Persistent data structures? HOT 1
- Java Support? HOT 1
- Import error in node/typescript project (No "exports" main defined in .../structurae/package.json) - 4.0.x HOT 1
- [Documentation] How to actually use BitField / BitArray in schema definitions? HOT 5
- Matrix operations for Grids.
- Feature request: Sorted Map HOT 2
- Question about sorted array and push() HOT 2
- Shouldn't SortedArray replace elements upon `push` or `unshift` if unique? HOT 3
- Grid.size needs better name
- Inheriting from DataView/TypedArray HOT 3
- Build failure trying to use structurae in typescript project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from structurae.