Skip to content

Commit 786f2dc

Browse files
committed
docs: Remove current from service-plugin
The docs were outdated, since the `current` workflow has been removed.
1 parent eebf75e commit 786f2dc

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

docs/2.0-major-release.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@ The `get` getter has also been updated to work with temp ids. Pass the tempId t
401401

402402
The `setCurrent` mutation and `currentId` state encouraged use of a very limiting API. It's much more common for apps to require more than one current record. The `createCopy`, `resetCopy` (formerly called `rejectCopy`), `commitCopy`, and `clearCopy` mutations (since v1.x) provide a more flexible solution for implementing the same functionality. As a result of this, following have been removed from the modules:
403403

404-
- state: `currentID`
405-
- getters: `current`
406-
- mutations: `setCurrent`, `clearList`, `copy`
404+
- state: `currentID`, `copy`
405+
- getters: `current`, `getCopy`
406+
- mutations: `setCurrent`, `clearCurrent`, `clearList`, `commitCopy`, `clearCopy`, `resetCopy`
407407

408408
## The `diffOnPatch` option has been removed
409409

docs/service-plugin.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ Each service comes loaded with the following default state:
9292
{
9393
ids: [],
9494
keyedById: {}, // A hash map, keyed by id of each item
95-
currentId: undefined, // The id of the item marked as current
9695
idField: 'id',
9796
servicePath: 'v1/todos' // The full service path
9897
autoRemove: false, // Indicates that this service will not automatically remove results missing from subsequent requests.
@@ -123,8 +122,6 @@ The following attributes are available in each service module's state:
123122

124123
- `ids {Array}` - an array of plain ids representing the ids that belong to each object in the `keyedById` map.
125124
- `keyedById {Object}` - a hash map keyed by the id of each item.
126-
- `currentId {Number|String}` - the id of the item marked as current.
127-
- `copy {Object}` - a deep copy of the current item at the moment it was marked as current. You can make changes to the copy without modifying the `current`. You can then use the `commitCopy` mutation to save the changes as the `current` or `resetCopy` to revert `copy` to once again match `current`. You may prefer to use the new [clone API](./common-patterns.md#Multiple-Copies) for [managing multiple copies with model instances](./common-patterns.md#Multiple-Copies).
128125
- `servicePath {String}` - the full service path, even if you alias the namespace to something else.
129126
- `modelName {String}` - the key in the $FeathersVuex plugin where the model will be found.
130127
- `autoRemove {Boolean` - indicates that this service will not automatically remove results missing from subsequent requests. Only use with feathers-rest. Default is false.
@@ -160,8 +157,6 @@ Service modules include the following getters:
160157
- `get(id[, params]) {Function}` - a function that allows you to query the store for a single item, by id. It works the same way as `get` requests in Feathers database adapters.
161158
- `id {Number|String}` - the id of the data to be retrieved by id from the store.
162159
- `params {Object}` - an object containing a Feathers `query` object.
163-
- `current {Object}` - the object representing the `currentId`. It's pulled from the `keyedById` state.
164-
- `getCopy {Object}` - An alias to the `state.copy`.
165160

166161
## Service Mutations
167162

@@ -204,20 +199,6 @@ Removes the passed in items or ids from the store.
204199

205200
- `items {Array}` - An array of ids or of objects with ids that will be removed from the data store.
206201

207-
### `commitCopy(state)`
208-
209-
Saves changes from the `copy` to the `current` item.
210-
211-
### `resetCopy(state)`
212-
213-
Re-copies the data from `current` to `copy`, restoring the original copy.
214-
215-
### `clearCurrent(state)`
216-
217-
> Removed in 2.0
218-
219-
Clears the `current` item, which also clears the copy.
220-
221202
### `clearList(state)`
222203

223204
> Removed in 2.0

0 commit comments

Comments
 (0)