summaryrefslogtreecommitdiffstats
path: root/examples/declarative/threading/threadedlistmodel/dataloader.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/threading/threadedlistmodel/dataloader.js')
-rw-r--r--examples/declarative/threading/threadedlistmodel/dataloader.js9
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]