Skip to content

Commit 23c12a3

Browse files
author
julianfoo
committed
Added explanation for removeAll function in the 'CRUD Functions' section in the createEntityAdapter API docs.
1 parent 4d74ce2 commit 23c12a3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/api/createEntityAdapter.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,13 @@ The primary content of an entity adapter is a set of generated reducer functions
206206
- `setAll`: accepts an array of entities or an object in the shape of `Record<EntityId, T>`, and replaces the existing entity contents with the values in the array.
207207
- `removeOne`: accepts a single entity ID value, and removes the entity with that ID if it exists.
208208
- `removeMany`: accepts an array of entity ID values, and removes each entity with those IDs if they exist.
209+
- `removeAll`: removes all entities from the entity state object.
209210
- `updateOne`: accepts an "update object" containing an entity ID and an object containing one or more new field values to update inside a `changes` field, and performs a shallow update on the corresponding entity.
210211
- `updateMany`: accepts an array of update objects, and performs shallow updates on all corresponding entities.
211212
- `upsertOne`: accepts a single entity. If an entity with that ID exists, it will perform a shallow update and the specified fields will be merged into the existing entity, with any matching fields overwriting the existing values. If the entity does not exist, it will be added.
212213
- `upsertMany`: accepts an array of entities or an object in the shape of `Record<EntityId, T>` that will be shallowly upserted.
213214

214-
Each method has a signature that looks like:
215+
Each method (except `removeAll`) has a signature that looks like:
215216

216217
```ts no-transpile
217218
(state: EntityState<T>, argument: TypeOrPayloadAction<Argument<T>>) => EntityState<T>

0 commit comments

Comments
 (0)