Skip to content

Instantly share code, notes, and snippets.

@frentsel
Last active February 10, 2017 05:56
Show Gist options
  • Save frentsel/23c8446f6f1dd01a3763 to your computer and use it in GitHub Desktop.
Save frentsel/23c8446f6f1dd01a3763 to your computer and use it in GitHub Desktop.
Pattern Meditor
var player = {
play: function(music){
console.info('player plaing: ', music);
}
};
var search = {
items: {
a: 'ABBA',
b: 'Boney M',
c: 'AC/DC',
},
get: function(q){
return this.items[q];
}
};
// Mediator
(function(){
var item = search.get('c');
player.play(item);
})();
// player plaing: AC/DC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment