File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
demo-app/imports/ui/components Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
<script setup>
2
2
// @ts-nocheck
3
3
import { Links } from ' /imports/api/links/links.js'
4
- import { subscribe , autorun } from ' meteor/vuejs:vue3'
4
+ import { subscribe , autoResult } from ' meteor/vuejs:vue3'
5
5
6
6
subscribe (' links.all' )
7
7
8
- const { result : links } = autorun (() => Links .find ({}))
8
+ const links = autoResult (() => Links .find ({}))
9
9
10
10
function submit (form ) {
11
11
const title = form .title
Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ export function autorun<TResult = unknown> (callback: () => TResult): AutorunEff
27
27
}
28
28
}
29
29
30
+ export function autoResult < TResult = unknown > ( callback : ( ) => TResult ) : ComputedRef < TResult | undefined > {
31
+ return autorun ( callback ) . result
32
+ }
33
+
30
34
export function subscribe ( name : string , ...args : any [ ] ) : Meteor . SubscriptionHandle {
31
35
const sub = Meteor . subscribe ( name , ...args )
32
36
onUnmounted ( ( ) => {
You can’t perform that action at this time.
0 commit comments