diff options
Diffstat (limited to 'examples/declarative/threading/threadedlistmodel/dataloader.js')
-rw-r--r-- | examples/declarative/threading/threadedlistmodel/dataloader.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/declarative/threading/threadedlistmodel/dataloader.js b/examples/declarative/threading/threadedlistmodel/dataloader.js new file mode 100644 index 0000000..d720f09 --- /dev/null +++ b/examples/declarative/threading/threadedlistmodel/dataloader.js @@ -0,0 +1,9 @@ +// ![0] +WorkerScript.onMessage = function(msg) { + if (msg.action == 'appendCurrentTime') { + var data = {'time': new Date().toTimeString()}; + msg.model.append(data); + msg.model.sync(); // updates the changes to the list + } +} +// ![0] |