For the function in Listing 2, extract the data property of the event, as this is the actual data sent by the thread, and pass it to another function for updating the UI.
对于清单2中的这个函数,提取event的data属性,因为这是被线程发送的实际数据,然后将它发送给另一个函数来更新ui。
In this example, the code that gets new tweets directly calls functions for updating the UI.
在本例中,得到新t weet的代码直接调用更新ui的函数。
So, that's the problem: we need a simple way to change a property of several UI elements by updating just one condition.
所以,这就是问题所在:我们需要一个简单的方法来改变数,更新用户界面的条件只有一个元素的财产。
Of course, your Controller function probably won't actually just log a message to the console, it can do anything needed by your app - whether it's fetching data, updating the UI or anything else.
当然你的控制器函数不会只是输出一段调试信息,你可以根据需要做任何事情,获取数据、更新界面或者其他什么的都行。
Of course, your Controller function probably won't actually just log a message to the console, it can do anything needed by your app - whether it's fetching data, updating the UI or anything else.
当然你的控制器函数不会只是输出一段调试信息,你可以根据需要做任何事情,获取数据、更新界面或者其他什么的都行。
应用推荐