@iankibetsh/vue-streamline 1.2.9 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iankibetsh/vue-streamline",
3
- "version": "1.2.9",
3
+ "version": "1.3.0",
4
4
  "description": "Vue library for streamlining laravel backend services with @iankibet/streamline composer package",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/App.vue CHANGED
@@ -22,19 +22,23 @@ const findPaybill = async ()=>{
22
22
  console.log(err)
23
23
  })
24
24
  }
25
+ const refresh = ()=>{
26
+ paybillService.refresh()
27
+ }
25
28
  </script>
26
29
 
27
30
  <template>
28
31
  <div>
29
32
  <hr/>
30
- <!-- <h3>Destructed: {{ testKey }}</h3>-->
31
- <!-- <h3>Original: {{ props.testKey }}</h3>-->
32
- <!-- <h3>Original: {{ props.testKey }}</h3>-->
33
- <!-- <h3>Original: {{ props.testKey }}</h3>-->
34
- <!-- <h3>Original: {{ props.testKey }}</h3>-->
35
- <!-- <h3 class="text-success" >Loading : {{ loading }}</h3>-->
36
- <!-- <h1 @click="findPaybill">Get Paybill</h1>-->
37
- <!-- {{ foundPaybill }}-->
33
+ <h3>Destructed: {{ testKey }}</h3>
34
+ <h3>Original: {{ props.testKey }}</h3>
35
+ <h3>Original: {{ props.testKey }}</h3>
36
+ <h3>Original: {{ props.testKey }}</h3>
37
+ <h3>Original: {{ props.testKey }}</h3>
38
+ <h3 class="text-success" >Loading : {{ loading }}</h3>
39
+ <h1 @click="findPaybill">Get Paybill</h1>
40
+ <h1 @click="refresh">Refresh</h1>
41
+ {{ foundPaybill }}
38
42
  </div>
39
43
  </template>
40
44
 
@@ -29,8 +29,10 @@ const useStreamline = (stream, ...initialArgs) => {
29
29
  }
30
30
  })
31
31
 
32
- const fetchServiceProperties = async () => {
33
- if (loading.value || propertiesFetched.value) return
32
+ const fetchServiceProperties = async (force) => {
33
+ if(!force){
34
+ if (loading.value || propertiesFetched.value) return
35
+ }
34
36
 
35
37
  try {
36
38
  loading.value = true
@@ -62,6 +64,9 @@ const useStreamline = (stream, ...initialArgs) => {
62
64
  }
63
65
 
64
66
  return (...args) => {
67
+ if(prop === 'refresh' || prop === 'reload'){
68
+ return fetchServiceProperties(true)
69
+ }
65
70
  if(prop === 'confirm'){
66
71
  return confirmAction(args[0] ?? 'Are you sure?')
67
72
  }