Skip to content

Instantly share code, notes, and snippets.

@morganney
Last active August 29, 2015 13:55
Show Gist options
  • Save morganney/8757713 to your computer and use it in GitHub Desktop.
Save morganney/8757713 to your computer and use it in GitHub Desktop.
Gister Module Interface Snippet.
/*
* Note that this module assumes support for
* MutationObservers and Promises.
* A polyfill for Promises is most likely needed.
*/
define(['jquery'], function($) {
var Gister = {
fetch: function(gistid) {
// Promise returning JSONP method to fetch Gists.
},
embedGists: function(dataAttrName) {
// Our MutationObserver callback to actually embed the Gists.
},
addGistCss: function addCss(filename) {
// Append the CSS file from GitHub to <head>.
addCss = function(){/* But only once! */};
}
// Possibly more methods ...
};
return Gister;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment