1
我正在用流星庫構建反應原生應用程序react-native-meteor我遇到了一個問題,我需要一個接一個地執行多個呼叫,例如,撥打登入 - >訂閱 - >訂閱Meteor React Native鏈接訂閱電話
在實踐中,它看起來是這樣的:
//Get a list of folders from my backend where I know
//a folder called "Mirror" lives
Meteor.subscribe('folders')
//get the id of the folder called "Mirror"
var mirrorFolder = Meteor.collection('folders').findOne({name: 'Mirror'})
//Using the id of the mirror folder I need to get a list of files
//within the mirror folder
Meteor.subscribe('files', mirrorFolder._id)
//Then get a list of all the files
var files = Meteor.collection('files').find()
但是由於認購呼叫沒有準備好後,我打電話給他們顯然這是不可能的。我錯過了一個簡單的方法嗎?
感謝您的迴應邁克爾。我最終使用了來自庫Trackr(這是流星追蹤器的一個分支)的「Trackr.autorun」中的ready變量。感謝您的幫助。 – elwesties