當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Map.valueSeq方法代碼示例

本文整理匯總了TypeScript中Immutable.Map.valueSeq方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Map.valueSeq方法的具體用法?TypeScript Map.valueSeq怎麽用?TypeScript Map.valueSeq使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Immutable.Map的用法示例。


在下文中一共展示了Map.valueSeq方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: handleDataChange

    public handleDataChange(uiObjects: Array<any>, state: Map<string, Map<string, any>>, objectType?: string|Object, options?: any): Array<any> {
        if (_.isObject(objectType)) {
            options = objectType;
            objectType = null;
        }
        options = options || {};

        let newObjects = _.sortBy(
            _.filter(
                state.valueSeq().toJS(),
                options.filter || _.identity
            ),
            options.sort || 'id'
        );
        if (!uiObjects) {
            uiObjects = newObjects;
        } else {
            _.forEach(newObjects, (newObject: any) => {
                let uiObject = _.find(uiObjects, {id: newObject.id});
                if (uiObject) {
                    Object.assign(uiObject, newObject);
                } else {
                    uiObjects.splice(_.sortedIndexBy(uiObjects, newObject, options.sort || 'id'), 0, newObject);
                }
            });
            _.forEachRight(uiObjects, uiObject => {
                if (!state.has(uiObject.id) && (!objectType || objectType === uiObject._objectType)) {
                    uiObjects.splice(_.indexOf(uiObjects, uiObject), 1);
                }
            });
        }
        return uiObjects;
    }
開發者ID:mactanxin,項目名稱:gui,代碼行數:33,代碼來源:data-object-change-service.ts

示例2: listAlerts

 public listAlerts(): Promise<Array<Object>> {
     return this.alerts ?
         Promise.resolve(this.alerts.valueSeq().toJS()) :
         this.alertDao.find({active: true, dismissed: false}).then(alerts => {
             this.alertDao.register();
             return alerts;
         });
 }
開發者ID:mactanxin,項目名稱:gui,代碼行數:8,代碼來源:alert-repository.ts

示例3: listNtpServers

 public listNtpServers(): Promise<Array<Object>> {
     return this.ntpServers ? Promise.resolve(this.ntpServers.valueSeq().toJS()) : this.ntpServerDao.list();
 }
開發者ID:mactanxin,項目名稱:gui,代碼行數:3,代碼來源:ntp-server-repository.ts

示例4: listBootDisks

 public listBootDisks() {
     return this.bootDisks ? this.bootDisks.valueSeq().toJS() : [];
 }
開發者ID:mactanxin,項目名稱:gui,代碼行數:3,代碼來源:disk-repository.ts

示例5: listAvailableDisks

 public listAvailableDisks() {
     return this.availableDisks ? this.availableDisks.valueSeq().toJS() : [];
 }
開發者ID:mactanxin,項目名稱:gui,代碼行數:3,代碼來源:disk-repository.ts

示例6: listDisks

 public listDisks(): Promise<Array<Object>> {
     return this.disks ? Promise.resolve(this.disks.valueSeq().toJS()) : this.diskDao.list();
 }
開發者ID:mactanxin,項目名稱:gui,代碼行數:3,代碼來源:disk-repository.ts

示例7: getGeneral

 public getGeneral(): Object {
     return this.systemGeneral ? Promise.resolve(this.systemGeneral.valueSeq().get(0).toJS()) : this.systemGeneralDao.get();
 }
開發者ID:mactanxin,項目名稱:gui,代碼行數:3,代碼來源:system-repository.ts

示例8: listShares

 public listShares(): Promise<Array<Object>> {
     return this.shares ? Promise.resolve(this.shares.valueSeq().toJS()) : this.shareDao.list();
 }
開發者ID:mactanxin,項目名稱:gui,代碼行數:3,代碼來源:share-repository.ts

示例9: listDatastores

 public listDatastores(peer: any) {
     return this.datastores ? Promise.resolve(this.datastores.valueSeq().toJS()) : this.vmwareDatastoreDao.listDatastoresOnPeer(peer);
 }
開發者ID:mactanxin,項目名稱:gui,代碼行數:3,代碼來源:vmware-repository.ts

示例10: listDatasets

 public listDatasets(): Promise<Array<any>> {
     return this.datasets ? Promise.resolve(this.datasets.valueSeq().toJS()) : this.vmwareDatasetDao.list();
 }
開發者ID:mactanxin,項目名稱:gui,代碼行數:3,代碼來源:vmware-repository.ts


注:本文中的Immutable.Map.valueSeq方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。