/+junk/gjs_values

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/gjs_values

« back to all changes in this revision

Viewing changes to main.js

  • Committer: Gustav Hartvigsson
  • Date: 2014-11-22 21:35:59 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20141122213559-lp6mmapzc02tfy2z
saving

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
imports.searchPath.unshift('.');
2
1
const Lang = imports.lang;
3
2
 
4
3
const Values = imports.values;
5
4
 
6
5
function main (argv) {
7
 
  var v = new Values.Values ({tellers: ["hello", "world"], domain: "Sweden"});
8
 
  
9
 
  v.listen ("hello", function () {
10
 
    print ("Hello");
11
 
  });
12
 
  v.listen ("hello", function () {
13
 
    print ("Hello again!");
14
 
  });
15
 
  
16
 
  v.listen ("world", function () {
17
 
    print ("world");
18
 
  });
19
 
  v.listen ("world", function () {
20
 
    print ("World again!");
21
 
  });
22
 
  
23
 
  v.tell ("hello");
24
 
  v.tell ("world");
25
 
  
26
 
  print ();
 
6
  
27
7
}
28
8
 
29
9
main (ARGV);