本文整理汇总了TypeScript中hasher.changed类的典型用法代码示例。如果您正苦于以下问题:TypeScript changed类的具体用法?TypeScript changed怎么用?TypeScript changed使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了changed类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
private constructor(private modelDescriptorService: ModelDescriptorService,
private eventDispatcherService: EventDispatcherService,
private middlewareClient: MiddlewareClient,
private datastoreService: DatastoreService,
private sectionRoute: SectionRoute,
private volumeRoute: VolumeRoute,
private shareRoute: ShareRoute,
private snapshotRoute: SnapshotRoute,
private datasetRoute: DatasetRoute,
private calendarRoute: CalendarRoute,
private systemRoute: SystemRoute,
private serviceRoute: ServicesRoute,
private peeringRoute: PeeringRoute,
private networkRoute: NetworkRoute,
private dockerRoute: DockerRoute,
private replicationRoute: ReplicationRoute) {
this.currentStacks = new Map<string, Array<any>>();
this.taskStacks = immutable.Map<number|string, Array<any>>();
this.sectionRouters = new Map<string, any>()
.set('accounts', AccountsRoute.getInstance())
.set('vms', VmsRoute.getInstance());
this.eventDispatcherService.addEventListener('taskSubmitted', this.handleTaskSubmitted.bind(this));
this.eventDispatcherService.addEventListener('taskCreated', this.handleTaskCreated.bind(this));
this.loadRoutes();
hasher.prependHash = '!';
hasher.changed.add(this.handleHashChange.bind(this));
}
示例2: activateCrossroads
private activateCrossroads() {
crossroads.normalizeFn = crossroads.NORM_AS_OBJECT;
hasher.initialized.add(this.parseHash);
hasher.changed.add(this.changeHash);
hasher.init();
}
示例3: resolve
return new Promise<Array<any>>((resolve) => {
let stack = this.currentStacks.get(sectionId);
this.changeHash(_.last(stack).path);
hasher.changed.addOnce(this.handleTaskHashChange.bind(this));
resolve(stack);
});