Last active
February 10, 2017 05:56
-
-
Save frentsel/23c8446f6f1dd01a3763 to your computer and use it in GitHub Desktop.
Pattern Meditor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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