initial: bootstrap from BukidBountyApp base
This commit is contained in:
22
resources/js/stores/network.js
Normal file
22
resources/js/stores/network.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
export const useNetworkStore = defineStore('network', {
|
||||
state: () => ({
|
||||
isOnline: navigator.onLine,
|
||||
isLoading: false
|
||||
}),
|
||||
actions: {
|
||||
setOnline(status) {
|
||||
this.isOnline = status
|
||||
if (status) {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
startLoading() {
|
||||
this.isLoading = true
|
||||
},
|
||||
stopLoading() {
|
||||
this.isLoading = false
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user