small tweak

pull/10781/head
Rich Harris 2 years ago
parent 047b557569
commit cc3bcae57d

@ -29,12 +29,12 @@ function get_self() {
return this;
}
let inited = false;
/**
* @template T
*/
export class ReactiveSet extends Set {
static #inited = false;
/** @type {Map<T, import('#client').Source<boolean>>} */
#sources = new Map();
#version = source(0);
@ -55,13 +55,13 @@ export class ReactiveSet extends Set {
}
}
this.#init();
if (!inited) this.#init();
}
// We init as part of the first instance so that we can treeshake this class
#init() {
if (!ReactiveSet.#inited) {
ReactiveSet.#inited = true;
inited = true;
const proto = ReactiveSet.prototype;
const set_proto = Set.prototype;
@ -74,7 +74,6 @@ export class ReactiveSet extends Set {
};
}
}
}
#increment_version() {
set(this.#version, this.#version.v + 1);

Loading…
Cancel
Save