Added chance operators to inline help

This commit is contained in:
2023-09-09 16:17:32 +03:00
parent 17b4805033
commit 1dab8cace6
4 changed files with 166 additions and 34 deletions

View File

@ -27,6 +27,11 @@ export abstract class Event {
return this;
};
// @ts-ignore
never = (func: Function): Event => {
return this;
};
almostNever = (func: Function): Event => {
return this.odds(0.025, func);
};
@ -55,6 +60,10 @@ export abstract class Event {
return this.odds(0.985, func);
};
always = (func: Function): Event => {
return this.modify(func);
};
modify = (func: Function): Event => {
return func(this);
};