Last active
April 5, 2020 14:44
-
-
Save boombang/6a73838cad008a19302bc1f08bc3ff52 to your computer and use it in GitHub Desktop.
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
//my-module.js | |
let privateVar = "Ben Cherry"; | |
export const publicVar = "Hey there!"; | |
const privateFunction = () => { | |
console.log( "Name:" + privateVar ); | |
} | |
export const publicSetName = (strName) => { | |
privateVar = strName; | |
} | |
export const publicGetName () => { | |
privateFunction(); | |
} | |
// index.js | |
import { publicSetName as setName } from 'my-module'; | |
setName("Paul Kinlan"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment