• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ecamp / hal-json-vuex / 13321877237

13 Feb 2025 10:43PM UTC coverage: 84.708%. Remained the same
13321877237

push

github

web-flow
Update babel monorepo to v7.26.8

159 of 206 branches covered (77.18%)

Branch coverage included in aggregate %.

262 of 291 relevant lines covered (90.03%)

740.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.0
/src/storeModule.js
1
import Vue from 'vue'
2

3
export const state = {}
6✔
4

5
export const mutations = {
6✔
6
  /**
7
   * Adds a placeholder into the store that indicates that the entity with the given URI is currently being
8
   * fetched from the API and not yet available.
9
   * @param state Vuex state
10
   * @param uri   URI of the object that is being fetched
11
   */
12
  addEmpty (state, uri) {
13
    Vue.set(state, uri, { _meta: { self: uri, loading: true } })
8,823✔
14
  },
15
  /**
16
   * Adds entities loaded from the API to the Vuex store.
17
   * @param state Vuex state
18
   * @param data  An object mapping URIs to entities that should be merged into the Vuex state.
19
   */
20
  add (state, data) {
21
    Object.keys(data).forEach(uri => {
9,498✔
22
      Vue.set(state, uri, data[uri])
16,176✔
23
    })
24
  },
25
  /**
26
   * Marks a single entity in the Vuex store as reloading, meaning a reloading network request is currently ongoin.
27
   * @param state Vuex state
28
   * @param uri   URI of the entity that is currently being reloaded
29
   */
30
  reloading (state, uri) {
31
    if (state[uri]) Vue.set(state[uri]._meta, 'reloading', true)
2,466!
32
  },
33
  /**
34
   * Marks a single entity in the Vuex store as normal again, after it has been marked as reloading before.
35
   * @param state Vuex state
36
   * @param uri   URI of the entity that is currently being reloaded
37
   */
38
  reloadingFailed (state, uri) {
39
    if (state[uri]) Vue.set(state[uri]._meta, 'reloading', false)
414!
40
  },
41
  /**
42
   * Removes a single entity from the Vuex store.
43
   * @param state Vuex state
44
   * @param uri   URI of the entity to be removed
45
   */
46
  purge (state, uri) {
47
    Vue.delete(state, uri)
1,974✔
48
  },
49
  /**
50
   * Removes a single entity from the Vuex store.
51
   * @param state Vuex state
52
   * @param uri   URI of the entity to be removed
53
   */
54
  purgeAll (state, uri) {
55
    Object.keys(state).forEach(uri => {
×
56
      Vue.delete(state, uri)
×
57
    })
58
  },
59
  /**
60
   * Marks a single entity in the Vuex store as deleting, meaning the process of deletion is currently ongoing.
61
   * @param state Vuex state
62
   * @param uri   URI of the entity that is currently being deleted
63
   */
64
  deleting (state, uri) {
65
    if (state[uri]) Vue.set(state[uri]._meta, 'deleting', true)
1,740!
66
  },
67
  /**
68
   * Marks a single entity in the Vuex store as normal again, after it has been marked as deleting before.
69
   * @param state Vuex state
70
   * @param uri   URI of the entity that failed to be deleted
71
   */
72
  deletingFailed (state, uri) {
73
    if (state[uri]) Vue.set(state[uri]._meta, 'deleting', false)
×
74
  }
75
}
76

77
export default {
78
  mutations
79
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc