feat(view): hook watch group instantiation in the view.

This commit is contained in:
Rado Kirov
2014-10-29 15:41:50 -07:00
parent 01e6c7b70c
commit 91f50b67b7
3 changed files with 111 additions and 42 deletions

View File

@ -39,10 +39,12 @@ export class ProtoWatchGroup {
this.tailRecord = tail;
}
instantiate(dispatcher:WatchGroupDispatcher):WatchGroup {
// TODO(rado): the type annotation should be dispatcher:WatchGroupDispatcher.
// but @Implements is not ready yet.
instantiate(dispatcher):WatchGroup {
var watchGroup:WatchGroup = new WatchGroup(this, dispatcher);
var tail:Record = null;
var proto:ProtoRecord;
var proto:ProtoRecord = null;
var prevRecord:Record = null;
if (this.headRecord !== null) {
@ -70,7 +72,9 @@ export class WatchGroup {
@FIELD('final dispatcher:WatchGroupDispatcher')
@FIELD('final headRecord:Record')
@FIELD('final tailRecord:Record')
constructor(protoWatchGroup:ProtoWatchGroup, dispatcher:WatchGroupDispatcher) {
// TODO(rado): the type annotation should be dispatcher:WatchGroupDispatcher.
// but @Implements is not ready yet.
constructor(protoWatchGroup:ProtoWatchGroup, dispatcher) {
this.protoWatchGroup = protoWatchGroup;
this.dispatcher = dispatcher;
this.headRecord = null;