Skip to content

Instantly share code, notes, and snippets.

@BrunoCaimar
Last active September 25, 2015 13:59
Show Gist options
  • Save BrunoCaimar/87d88e06758d5b0d644c to your computer and use it in GitHub Desktop.
Save BrunoCaimar/87d88e06758d5b0d644c to your computer and use it in GitHub Desktop.
Dojo - Topic / Events / AMD
-- Topic - Pub/Sub infra
---- topic.subscribe / topic.publish
-- Dojo/On - Events related to objects or DOM
---- dojo.on(target, event, function2handleIt)
---- dojo.on.emit(target, event, params)
---- on.once(t, e, f) - Run just once
AMD
"my/otherModule" is one directory up, so we use "../"
"my/widget/InfoBox" is in the same directory, so we use "./"
lang
- extend/mixin to 'monkey patching'
lang.hitch
- provides context to an event (like put actual 'this' in a specified event context)
lang.partial
- fixed params to functions like callbacks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment