You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/service-module.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,15 +164,21 @@ Removes a single item. `item` can be
164
164
Removes the passed in items or ids from the store.
165
165
-`items {Array}` - An array of ids or of objects with ids that will be removed from the data store.
166
166
167
-
### `setCurrent(state, item)`
167
+
### `setCurrent(state, itemOrId)`
168
168
-`item {Number|String|Object}` - the object with id to be set as the current item, or the id of the object in the store that should become the `current` item. Setting the `current` item or id also create the deep-cloned `copy`.
169
169
170
-
### `commitCopy(state)`
170
+
### `createCopy(state, id)`
171
+
Creates a copy of the record with the passed-in id, stores it in copiesById
172
+
173
+
### `commitCopy(state, id)`
171
174
Saves changes from the `copy` to the `current` item.
172
175
173
-
### `rejectCopy(state)`
176
+
### `rejectCopy(state, id)`
174
177
Re-copies the data from `current` to `copy`, restoring the original copy.
175
178
179
+
### `clearCopy(state, id)`
180
+
Removes the copy from copiesById
181
+
176
182
### `clearCurrent(state)`
177
183
Clears the `current` item, which also clears the copy.
178
184
@@ -182,6 +188,10 @@ Clears the `list`, excepting the `current` item.
182
188
### `clearAll(state)`
183
189
Clears all data from `ids`, `keyedById`, and `currentId`
0 commit comments