Last active
May 7, 2018 21:24
-
-
Save argyleink/3e571e5176019d463e537bc995acdea8 to your computer and use it in GitHub Desktop.
simple, safe, compose-able, testable logic container
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
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