001dbefbcf
because it becomes hard to remember where you used them and where not
32 lines
637 B
JavaScript
32 lines
637 B
JavaScript
export class UpdateAction {
|
|
constructor(remove, update, updateParams) {
|
|
this._remove = remove;
|
|
this._update = update;
|
|
this._updateParams = updateParams;
|
|
}
|
|
|
|
get shouldRemove() {
|
|
return this._remove;
|
|
}
|
|
|
|
get shouldUpdate() {
|
|
return this._update;
|
|
}
|
|
|
|
get updateParams() {
|
|
return this._updateParams;
|
|
}
|
|
|
|
static Remove() {
|
|
return new UpdateAction(true, false, null);
|
|
}
|
|
|
|
static Update(newParams) {
|
|
return new UpdateAction(false, true, newParams);
|
|
}
|
|
|
|
static Nothing() {
|
|
return new UpdateAction(false, false, null);
|
|
}
|
|
}
|