Namespace

mutations

jsonapi-vuex.jsonapiModule.mutations

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

View Source mutations.js, line 1

Methods

# static addRecords(state, records)

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

Parameters:
Name Type Description
state object

The Vuex state object

records object

The record(s) to be added

View Source mutations.js, line 40

# static clearRecords(state, records)

Delete all records from the store for a given type

Parameters:
Name Type Description
state object

The Vuex state object

records object

A record with type set.

View Source mutations.js, line 67

# static deleteRecord(state, record)

Delete a record from the store.

Parameters:
Name Type Description
state object

The Vuex state object

record string | object

The record to be deleted

View Source mutations.js, line 19

# static mergeRecords(state, records)

Merge (or add) records to the store

Parameters:
Name Type Description
state object

The Vuex state object

records object

The record(s) to be merged

View Source mutations.js, line 58

# static replaceRecords(state, records)

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

Parameters:
Name Type Description
state object

The Vuex state object

records object

The record(s) to be replaced

View Source mutations.js, line 49