Collections
The Collections module has a variety of data-structures to supplement those already available in the web platform.
Data structures
Section titled “Data structures”In brief:
- Queue: first-in, first-out ranked data. Like the queue at a bakery
- Stack: first-in, last-out ranked data. Like a stack of plates, you can’t just grab the one at the bottom
- Set: unique data
- Map: relate keys with values, like a dictionary
- Tree: structured data of parents and children
- Graph: relations
Importing
Section titled “Importing”// Whole moduleimport * as Collections from "@ixfx/collections.js"
// Single functionimport { circularArray } from "@ixfx/collections.js"
// And within your HTML's <HEAD> </HEAD> block:<script type="importmap">{ "imports": { "@ixfx":"/ixfx/core.js", "@ixfx/": "/ixfx/" } }</script>// Whole moduleimport * as Collections from "@ixfx/collections"
// Single functionimport { circularArray } from "@ixfx/collections"// Single module from the bundleimport * as Collections from "https://unpkg.com/ixfx/dist/collections.js"
// Single functionimport { circularArray } from "https://unpkg.com/ixfx/dist/collections.js"