当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript mobx.IObservableValue类代码示例

本文整理汇总了TypeScript中mobx.IObservableValue的典型用法代码示例。如果您正苦于以下问题:TypeScript IObservableValue类的具体用法?TypeScript IObservableValue怎么用?TypeScript IObservableValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了IObservableValue类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: is

 @computed
 public get is(): boolean {
   // console.log(`GET:${this.objectId()}:`, this.value);
   if (typeof(this.value.get()) === 'boolean') {
     return this.value.get();
   }
   return this.parent.is;
 }
开发者ID:mabels,项目名称:clavator,代码行数:8,代码来源:nested-flag.ts

示例2: verifyText

 public verifyText(): string[] {
   const ret: string[] = [];
   if (!this.match.test(this.pin.get())) {
     ret.push(`Pin does not match:${this.match.toString()}`);
   }
   return ret;
 }
开发者ID:mabels,项目名称:clavator,代码行数:7,代码来源:pin.ts

示例3: verifyText

 public verifyText(): string[] {
   let ret: string[] = [];
   if (this.fingerprint.length == 0) {
     ret.push('fingerprint had to set.');
   }
   if (typeof this.slot_id.get() !== 'number' && this.slot_id.get() < 0) {
     ret.push('slot_id not set.');
   }
   if (this.card_id.length == 0) {
     ret.push('card-id had to be set.');
   }
   ret = ret.concat(this.admin_pin.verifyText());
   if (typeof this.passphrase.get() !== 'string' || this.passphrase.get().length <= 8) {
     ret.push('passphrase had to be set.');
   }
   return ret;
 }
开发者ID:mabels,项目名称:clavator,代码行数:17,代码来源:key-to-yubikey.ts

示例4:

 this.date.observe(action((chg: IValueDidChange<Date>) => {
   const f = format_date(chg.newValue);
   this.formatDate.set(f);
   // chg.newValue.setHours(0);
   // chg.newValue.setMinutes(0);
   // chg.newValue.setSeconds(0);
   // chg.newValue.setMilliseconds(0);
   // console.log('observe fix', chg.newValue);
 }));
开发者ID:mabels,项目名称:clavator,代码行数:9,代码来源:date-value.ts

示例5: asKeyToYubiKey

 public asKeyToYubiKey(fpr: string, slot_id: number): KeyToYubiKey {
   const ktyk = new KeyToYubiKey({
     slot_id,
     card_id: this.smartCardId.get(),
     admin_pin: new Pin({ pin: '12345678'}),
     fingerprint: fpr,
     passphrase: this.passPhrase.getPassPhrase(),
   });
   return ktyk;
 }
开发者ID:mabels,项目名称:clavator,代码行数:10,代码来源:simple-yubikey.ts

示例6: toObj

 public toObj(): any {
   return {
     smartCardId: this.smartCardId.get(),
     warrents: this.warrents.toObj(),
     common: this.common.toObj(),
     passPhrase: this.passPhrase.toObj(),
     adminKey: this.adminKey.toObj(),
     userKey: this.userKey.toObj(),
   };
 }
开发者ID:mabels,项目名称:clavator,代码行数:10,代码来源:simple-yubikey.ts

示例7: constructor

 public constructor(v: Date, e: string) {
   super('DateValue');
   this.errText = e;
   this.date = observable.box(undefined);
   this.date.observe(action((chg: IValueDidChange<Date>) => {
     const f = format_date(chg.newValue);
     this.formatDate.set(f);
     // chg.newValue.setHours(0);
     // chg.newValue.setMinutes(0);
     // chg.newValue.setSeconds(0);
     // chg.newValue.setMilliseconds(0);
     // console.log('observe fix', chg.newValue);
   }));
   this.formatDate = observable.box(undefined);
   this.formatDate.observe(action((chg: IValueDidChange<string>) => {
     this.date.set(new Date(chg.newValue));
   }));
   action(() => this.formatDate.set(format_date(v)))();
 }
开发者ID:mabels,项目名称:clavator,代码行数:19,代码来源:date-value.ts

示例8: approved

 @computed
 public get approved(): boolean {
   return this._approved.get();
 }
开发者ID:mabels,项目名称:clavator,代码行数:4,代码来源:view-warrent.ts

示例9: toObj

 public toObj(): DateValueObj {
   return {
     formatDate: this.formatDate.get(),
     errText: this.errText
   };
 }
开发者ID:mabels,项目名称:clavator,代码行数:6,代码来源:date-value.ts


注:本文中的mobx.IObservableValue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。