imports/vx/client/code/ux.js
/**
     * Wait on multiple subscriptions and invoke callback when ready.
     *
     * @param {array} handles Array of subscription handles.
     * @param {function} callback Callback.
     */
Wait on multiple subscriptions and invoke callback when ready.
@param {array} handles Array of subscription handles.
@param {function} callback Callback.
Wait on multiple subscriptions and invoke callback when ready . @param { array } handles Array of subscription handles . @param { function } callback Callback .
waitSubscriptions(handles, callback) {
        OLog.warn(`ux.js waitSubscriptions *waiting* total of ${handles.length} subscriptions to be published`)
        try {
            if (UX.areSubscriptionsReady(handles)) {
                OLog.warn("ux.js waitSubscriptions immediately *ready* continue")
                callback(null, { success: true })
                return
            }
            Tracker.autorun(computation => {
                if (UX.areSubscriptionsReady(handles)) {
                    OLog.warn(`ux.js waitSubscriptions *ready* total of ${handles.length} subscriptions ` +
                        "published stopping wait computation and invoking post-publication callback")
                    computation.stop()
                    callback(null, { success: true })
                    return
                }
            })
        }
        catch (error) {
            OLog.error("ux.js waitSubscriptions unexpected error=" + error)
            return
        }
    }
waitSubscriptions ( handles , callback ) { OLog . warn ( ` ${ handles . length } ` ) try { if ( UX . areSubscriptionsReady ( handles ) ) { OLog . warn ( "ux.js waitSubscriptions immediately *ready* continue" ) callback ( null , { success : true } ) return } Tracker . autorun ( computation => { if ( UX . areSubscriptionsReady ( handles ) ) { OLog . warn ( ` ${ handles . length } ` + "published stopping wait computation and invoking post-publication callback" ) computation . stop ( ) callback ( null , { success : true } ) return } } ) } catch ( error ) { OLog . error ( "ux.js waitSubscriptions unexpected error=" + error ) return } }
Wait on multiple subscriptions and invoke callback when ready.
Wait on multiple subscriptions and invoke callback when ready .