Skip to content

Instantly share code, notes, and snippets.

@ryanve
Last active December 31, 2017 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanve/c11d012aa6fdf90bee110cceff428bfa to your computer and use it in GitHub Desktop.
Save ryanve/c11d012aa6fdf90bee110cceff428bfa to your computer and use it in GitHub Desktop.
Classing singleton interface example
const facade = Object.freeze({
  "Example": "inline-block p2",
});

const classing = function(name) {
  if (!facade.hasOwnProperty(name)) throw new Error("Unknown classing: " + name);
  return facade[name];
}

module.exports = classing;

led to https://github.com/ryanve/cader

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