|
@@ -16,6 +16,10 @@ return smalltalk.withContext(function($ctx1) {
|
|
|
smalltalk.App.superclass.fn.prototype._initialize.apply(_st(self), []);
|
|
|
self._dispatcher_(_st($SimpleKeyedPubSub())._new());
|
|
|
self._model_(_st(_st($AppModel())._new())._title_("Todo"));
|
|
|
+self._watch_do_([["todos"], nil],(function(){
|
|
|
+return smalltalk.withContext(function($ctx2) {
|
|
|
+return _st(self._dispatcher())._changed_([["remaining"]]);
|
|
|
+}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
|
|
|
_st((function(){
|
|
|
return smalltalk.withContext(function($ctx2) {
|
|
|
return self._modify_do_([["todos"]],(function(){
|
|
@@ -25,8 +29,8 @@ return [smalltalk.HashedCollection._from_(["text".__minus_gt("learn trapped"),"d
|
|
|
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((2000));
|
|
|
return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.App)})},
|
|
|
args: [],
|
|
|
-source: "initialize\x0a\x09super initialize.\x0a self dispatcher: SimpleKeyedPubSub new.\x0a self model: (AppModel new title: 'Todo').\x0a [ self modify: #((todos)) do: [{\x0a #{'text'->'learn trapped'. 'done'->true}.\x0a #{'text'->'build a trapped app'. 'done'->false}\x0a }]] valueWithTimeout: 2000",
|
|
|
-messageSends: ["initialize", "dispatcher:", "new", "model:", "title:", "valueWithTimeout:", "modify:do:", "->"],
|
|
|
+source: "initialize\x0a\x09super initialize.\x0a self dispatcher: SimpleKeyedPubSub new.\x0a self model: (AppModel new title: 'Todo').\x0a\x09self watch: #((todos) nil) do: [ self dispatcher changed: #((remaining)) ].\x0a [ self modify: #((todos)) do: [{\x0a #{'text'->'learn trapped'. 'done'->true}.\x0a #{'text'->'build a trapped app'. 'done'->false}\x0a }]] valueWithTimeout: 2000",
|
|
|
+messageSends: ["initialize", "dispatcher:", "new", "model:", "title:", "watch:do:", "changed:", "dispatcher", "valueWithTimeout:", "modify:do:", "->"],
|
|
|
referencedClasses: ["SimpleKeyedPubSub", "AppModel"]
|
|
|
}),
|
|
|
smalltalk.App);
|