diff options
| author | bob <bcz@cs.brown.edu> | 2019-05-02 16:19:07 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-05-02 16:19:07 -0400 |
| commit | a78282cdf7fbb99386484640e1fb89d4b9b0cbee (patch) | |
| tree | 9154148f03f996e5c6fb8c2e367df13736d8b0cc /src/new_fields/List.ts | |
| parent | a79bda7e5c7e77e398a33b8262f861155c5f1462 (diff) | |
fixed some things with trees and summaries.
Diffstat (limited to 'src/new_fields/List.ts')
| -rw-r--r-- | src/new_fields/List.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/new_fields/List.ts b/src/new_fields/List.ts index 1c4b96c81..db7932cec 100644 --- a/src/new_fields/List.ts +++ b/src/new_fields/List.ts @@ -2,7 +2,7 @@ import { Deserializable, autoObject } from "../client/util/SerializationHelper"; import { Field, Update, Self, FieldResult } from "./Doc"; import { setter, getter, deleteProperty } from "./util"; import { serializable, alias, list } from "serializr"; -import { observable } from "mobx"; +import { observable, action } from "mobx"; import { ObjectField, OnUpdate, Copy } from "./ObjectField"; import { RefField } from "./RefField"; import { ProxyField } from "./Proxy"; @@ -25,12 +25,12 @@ const listHandlers: any = { this[Update](); return field; }, - push(...items: any[]) { + push: action(function (this: any, ...items: any[]) { items = items.map(toObjectField); const res = this[Self].__fields.push(...items); this[Update](); return res; - }, + }), reverse() { const res = this[Self].__fields.reverse(); this[Update](); |
