-const Log = {
- addTask: function (description: string) {
- this.applyLogEntry(`${Date.now()} Create ${description}`);
- },
+const Log = (function () {
+ var next_log_index = 0;
+ return {
+ apply: function (entry: string) {
+ const [timestamp, command, data] = splitN(entry, " ", 2);
+ if (command == "Create") {
+ Model.addTask(timestamp, data);
+ }
+ },