17 lines
401 B
TypeScript
Raw Normal View History

2020-06-28 16:55:44 +02:00
import { PatchAction } from '../classes/PatchAction';
export class ActionFactory {
private static _actions: Record<string, (json:string)=>PatchAction> = {};
public static get (name:string, json:string): PatchAction {
return this._actions[name] (json);
}
public static register (
name:string,
constr: (json:string)=>PatchAction
):void {
this._actions[name] = constr;
}
}