diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-05-02 23:13:30 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-05-02 23:13:30 -0400 |
commit | ee6842b6509264f402217fcd214fa4dc167d985e (patch) | |
tree | 8890dbfddbb04b8033c8b086e01e5dedb2e836a4 /src/new_fields/List.ts | |
parent | 14232f5951af02d5a10ce0435a8b38a4e0502cbb (diff) | |
parent | a9b457e06990ec1c2faf8ea32ba47e9377a25fea (diff) |
Merge branch 'newDocs' of github-tsch-brown:browngraphicslab/Dash-Web into newDocs
Diffstat (limited to 'src/new_fields/List.ts')
-rw-r--r-- | src/new_fields/List.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/new_fields/List.ts b/src/new_fields/List.ts index db7932cec..96018dafa 100644 --- a/src/new_fields/List.ts +++ b/src/new_fields/List.ts @@ -46,12 +46,12 @@ const listHandlers: any = { this[Update](); return res; }, - splice(start: number, deleteCount: number, ...items: any[]) { + splice: action(function (this: any, start: number, deleteCount: number, ...items: any[]) { items = items.map(toObjectField); const res = this[Self].__fields.splice(start, deleteCount, ...items); this[Update](); return res.map(toRealField); - }, + }), unshift(...items: any[]) { items = items.map(toObjectField); const res = this[Self].__fields.unshift(...items); @@ -60,9 +60,9 @@ const listHandlers: any = { }, /// Accessor methods - concat(...items: any[]) { + concat: action(function (this: any, ...items: any[]) { return this[Self].__fields.map(toRealField).concat(...items); - }, + }), includes(valueToFind: any, fromIndex: number) { const fields = this[Self].__fields; if (valueToFind instanceof RefField) { |