Fix minor error with cache function

This commit is contained in:
2024-04-14 23:43:55 +02:00
parent 57f0c9dfe6
commit 4801f78deb
2 changed files with 10 additions and 11 deletions

View File

@ -346,8 +346,8 @@ export class UserAPI {
this.mean = Mathematics.mean(); this.mean = Mathematics.mean();
this.limit = Mathematics.limit(); this.limit = Mathematics.limit();
this.abs = Mathematics.abs(); this.abs = Mathematics.abs();
this.z = Ziffers.z(this.app); this.z = Ziffers.z(this);
Object.assign(this, Ziffers.generateZFunctions(this.app)); Object.assign(this, Ziffers.generateZFunctions(this));
this.fullseq = Filters.fullseq(); this.fullseq = Filters.fullseq();
this.seq = Filters.seq(this.app); this.seq = Filters.seq(this.app);
this.beat = Filters.beat(this.app); this.beat = Filters.beat(this.app);
@ -395,14 +395,14 @@ export class UserAPI {
this.always = Probability.always(); this.always = Probability.always();
this.dice = Probability.dice(this); this.dice = Probability.dice(this);
this.osc = OSC.osc(this.app); this.osc = OSC.osc(this.app);
this.getOSC = OSC.getOSC(this.app); this.getOSC = OSC.getOSC();
this.gif = Canvas.gif(this.app); this.gif = Canvas.gif(this.app);
this.scope = Canvas.scope(this.app); this.scope = Canvas.scope(this.app);
this.randI = Randomness.randI(this.app); this.randI = Randomness.randI(this);
this.rand = Randomness.rand(this.app); this.rand = Randomness.rand(this);
this.seed = Randomness.seed(this.app); this.seed = Randomness.seed(this);
this.localSeededRandom = Randomness.localSeededRandom(this.app); this.localSeededRandom = Randomness.localSeededRandom(this);
this.clearLocalSeed = Randomness.clearLocalSeed(this.app); this.clearLocalSeed = Randomness.clearLocalSeed(this);
this.once = Counter.once(this); this.once = Counter.once(this);
this.counter = Counter.counter(this); this.counter = Counter.counter(this);
this.$ = this.counter; this.$ = this.counter;
@ -421,9 +421,8 @@ export class UserAPI {
this.epulse = Transport.epulse(this.app); this.epulse = Transport.epulse(this.app);
this.nominator = Transport.nominator(this.app); this.nominator = Transport.nominator(this.app);
this.meter = Transport.meter(this.app); this.meter = Transport.meter(this.app);
this.denominator = Transport.denominator(this.app); // Alias for meter this.denominator = Transport.denominator(this.app);
this.pulsesForBar = Transport.pulsesForBar(this.app); this.pulsesForBar = Transport.pulsesForBar(this.app);
} }
public g: any; public g: any;

View File

@ -8,7 +8,7 @@ export const generateCacheKey = () => (...args: any[]): string => {
}; };
export const resetAllFromCache = (api: UserAPI) => (): void => { export const resetAllFromCache = (api: UserAPI) => (): void => {
api.patternCache.forEach((player: Player) => player.reset()); api.patternCache.forEach((player) => (player as Player).reset());
}; };
export const clearPatternCache = (api: UserAPI) => (): void => { export const clearPatternCache = (api: UserAPI) => (): void => {