Namespace: mutations

pinia-jsonapi.createJsonapiStore.mutations

Pinia mutations, used via this.$store.commit()

Source:

Methods

(static) addRecords(state, records)

Add record(s) to the store, according to mergeRecords config option

Parameters:
Name Type Description
state object

The Pinia state object

records object

The record(s) to be added

Source:

(static) clearRecords(state, records)

Delete all records from the store (of a given type) other than those included in a given record

Parameters:
Name Type Description
state object

The Pinia state object

records object

A record with type set.

Source:

(static) deleteRecord(state, record)

Delete a record from the store.

Parameters:
Name Type Description
state object

The Pinia state object

record string | object

The record to be deleted

Source:

(static) mergeRecords(state, records)

Merge (or add) records to the store

Parameters:
Name Type Description
state object

The Pinia state object

records object

The record(s) to be merged

Source:

(static) replaceRecords(state, records)

Replace (or add) record(s) to the store

Parameters:
Name Type Description
state object

The Pinia state object

records object

The record(s) to be replaced

Source: