Nicolas Petton
Leaving soon 😓
Expose Pharo Objects to Amber
MyCounter >> increase <action> count := count + 1 MyCounter >> decrease <action> count := count - 1 MyCounter >> count <state> ^ count presenter := MyCounter new asPresenter. "=> a TDPresenter"
{ "actions":{ "increase":"/counter?_callback=rewjkl", "decrease":"/counter?_callback=rewiof", }, "state":{ "count":0 } }
Default presenters for:
TDModelPresenter
proxy := TDClientProxy on: '/counter'. proxy connect
proxy count. "=> 0" proxy increase then: [ proxy count ]. "=> 1" proxy decrease; decrease; then: [ proxy count ]. "=> -1" 5 timesRepeat: [ proxy increase ].