Skip to content

Instantly share code, notes, and snippets.

@Kolenov
Created September 5, 2017 16:58
Show Gist options
  • Save Kolenov/6194575f22b1cc3cdb07e81799b5021f to your computer and use it in GitHub Desktop.
Save Kolenov/6194575f22b1cc3cdb07e81799b5021f to your computer and use it in GitHub Desktop.
var pageFacade = {
updateMenu: function() {
loadData();
resizeColumn();
updateCounter();
setLog();
},
doSmthElse: function() {
// a lot of methods
}
};
// Usage:
// Instead of all functions invocation
pageFacade.updateMenu();
@Kolenov
Copy link
Author

Kolenov commented Sep 5, 2017

Facade

Wherefore
This pattern provides a convenient higher-level interface to a larger body of code, hiding its true underlying complexity.
Howto
Creating set of facade methods and joining them in one place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment