Skip to content

Instantly share code, notes, and snippets.

@argyleink
Last active May 7, 2018 21:24
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 argyleink/3e571e5176019d463e537bc995acdea8 to your computer and use it in GitHub Desktop.
Save argyleink/3e571e5176019d463e537bc995acdea8 to your computer and use it in GitHub Desktop.
simple, safe, compose-able, testable logic container
const module = (deps) => {
const actuallyPrivate = 'foo'
return Object.freeze({
interface
})
const interface = () =>
console.log(deps, actuallyPrivate)
}
// usage
const foo = module({hi:'hello'})
foo.interface()
// {hi:'hello'}, 'foo'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment