mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-10-12 22:11:58 +00:00
Add a limited legacy API to support at least basic channel and global emotes from FFZ:AP.
This commit is contained in:
parent
21b598b92d
commit
c86895797c
5 changed files with 351 additions and 6 deletions
|
@ -186,6 +186,10 @@ export class SourcedSet {
|
|||
get(key) { return this._sources && this._sources.get(key) }
|
||||
has(key) { return this._sources ? this._sources.has(key) : false }
|
||||
|
||||
includes(val) {
|
||||
return this._cache.includes(val);
|
||||
}
|
||||
|
||||
delete(key) {
|
||||
if ( this._sources && this._sources.has(key) ) {
|
||||
this._sources.delete(key);
|
||||
|
@ -236,4 +240,18 @@ export class SourcedSet {
|
|||
if ( ! this._cache.includes(val) )
|
||||
this._cache.push(val);
|
||||
}
|
||||
|
||||
remove(key, val) {
|
||||
if ( ! this.has(key) )
|
||||
return;
|
||||
|
||||
const old_val = this._sources.get(key),
|
||||
idx = old_val.indexOf(val);
|
||||
|
||||
if ( idx === -1 )
|
||||
return;
|
||||
|
||||
old_val.splice(idx, 1);
|
||||
this._rebuild();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue