Skip to content

Commit 74b96d6

Browse files
Merge pull request #42 from Geode-solutions/feat_composable_function_runner
Feat composable function runner
2 parents e72c12b + 60e1c94 commit 74b96d6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export default function (function_to_run) {
2+
const cloud_store = use_cloud_store()
3+
const { is_running } = storeToRefs(cloud_store)
4+
5+
if (is_running.value) {
6+
function_to_run()
7+
} else {
8+
watch(is_running, (value) => {
9+
if (value) {
10+
function_to_run()
11+
}
12+
})
13+
}
14+
}

0 commit comments

Comments
 (0)