diff --git a/src/utils/onUserId.js b/src/utils/onUserId.js
new file mode 100644
index 00000000..28c1fcae
--- /dev/null
+++ b/src/utils/onUserId.js
@@ -0,0 +1,19 @@
+import { watch } from 'vue';
+
+import { useUserStore } from 'stores/user';
+
+const userStore = useUserStore();
+
+export const onUserId = (cb) => watch(
+  () => userStore?.user?.id,
+  async userId => {
+    if (userId) {
+      try {
+        await cb(userId);
+      } catch (error) {
+        console.error(error);
+      }
+    }
+  },
+  { immediate: true }
+);