本文整理匯總了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;
}
示例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;
});
}
示例3: listNtpServers
public listNtpServers(): Promise<Array<Object>> {
return this.ntpServers ? Promise.resolve(this.ntpServers.valueSeq().toJS()) : this.ntpServerDao.list();
}
示例4: listBootDisks
public listBootDisks() {
return this.bootDisks ? this.bootDisks.valueSeq().toJS() : [];
}
示例5: listAvailableDisks
public listAvailableDisks() {
return this.availableDisks ? this.availableDisks.valueSeq().toJS() : [];
}
示例6: listDisks
public listDisks(): Promise<Array<Object>> {
return this.disks ? Promise.resolve(this.disks.valueSeq().toJS()) : this.diskDao.list();
}
示例7: getGeneral
public getGeneral(): Object {
return this.systemGeneral ? Promise.resolve(this.systemGeneral.valueSeq().get(0).toJS()) : this.systemGeneralDao.get();
}
示例8: listShares
public listShares(): Promise<Array<Object>> {
return this.shares ? Promise.resolve(this.shares.valueSeq().toJS()) : this.shareDao.list();
}
示例9: listDatastores
public listDatastores(peer: any) {
return this.datastores ? Promise.resolve(this.datastores.valueSeq().toJS()) : this.vmwareDatastoreDao.listDatastoresOnPeer(peer);
}
示例10: listDatasets
public listDatasets(): Promise<Array<any>> {
return this.datasets ? Promise.resolve(this.datasets.valueSeq().toJS()) : this.vmwareDatasetDao.list();
}