1.0.0 • Published 10 months ago
@esfx/collection-core v1.0.0
@esfx/collection-core
The @esfx/collection-core
package provides a low-level Symbol-based API for defining common collection behaviors.
Overview
Installation
npm i @esfx/collection-core
Usage
import { Collection } from "@esfx/collection-core";
class MyCollection {
constructor() {
this._items = new Set();
}
// Your implementation
get count() { return this._items.size; }
contains(value) { return this._items.has(value); }
add(value) { this._items.add(value); }
remove(value) { return this._items.delete(value); }
clear() { this._items.clear(); }
// Implement the `Collection` interface for cross-library consistency
get [Collection.size]() { return this.count; }
[Collection.has](value) { return this.contains(value); }
[Collection.add](value) { this.add(value); }
[Collection.delete](value) { return this.remove(value); }
[Collection.clear]() { this.clear(); }
[Symbol.iterator]() { return this._items.values(); }
}
API
You can read more about the API here.
1.1.0-alpha.202307260322
10 months ago
1.1.0-alpha.202302091715
1 year ago
1.1.0-alpha.202306061406
11 months ago
1.1.0-alpha.202306061316
11 months ago
1.1.0-alpha.202306051228
11 months ago
1.1.0-alpha.202306080253
11 months ago
1.1.0-alpha.202302071935
1 year ago
1.1.0-alpha.202305082104
1 year ago
1.1.0-alpha.202211221509
1 year ago
1.1.0-alpha.202210252139
2 years ago
1.0.0
2 years ago
1.0.0-dev.7
2 years ago
1.0.0-pre.42
2 years ago
1.0.0-dev.8
2 years ago
1.0.0-pre.41
2 years ago
1.0.0-dev.5
2 years ago
1.0.0-pre.44
2 years ago
1.0.0-dev.6
2 years ago
1.0.0-pre.43
2 years ago
1.0.0-dev.4
2 years ago
1.0.0-prenative.0
2 years ago
1.0.0-prenative.1
2 years ago
1.0.0-dev.0
2 years ago
1.0.0-pre.40
2 years ago
1.0.0-pre.31
2 years ago
1.0.0-pre.33
2 years ago
1.0.0-pre.35
2 years ago
1.0.0-pre.34
2 years ago
1.0.0-pre.37
2 years ago
1.0.0-pre.36
2 years ago
1.0.0-pre.39
2 years ago
1.0.0-pre.38
2 years ago
1.1.0-alpha.202211291446
1 year ago
1.0.0-pre.24
3 years ago
1.0.0-pre.23
3 years ago
1.0.0-pre.19
3 years ago
1.0.0-pre.17
3 years ago
1.0.0-pre.16
3 years ago
1.0.0-pre.13
5 years ago
1.0.0-pre.12
5 years ago
1.0.0-pre.11
5 years ago
1.0.0-pre.10
5 years ago
1.0.0-pre.9
5 years ago
1.0.0-pre.8
5 years ago
1.0.0-pre.6
5 years ago
1.0.0-pre.5
5 years ago
1.0.0-pre.4
5 years ago
1.0.0-pre.3
5 years ago
1.0.0-pre.2
5 years ago
1.0.0-pre.1
5 years ago
1.0.0-pre.0
5 years ago