Skip to content

Instantly share code, notes, and snippets.

@wavebeem
Created November 13, 2015 16:11
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 wavebeem/fbd290165903d0a07813 to your computer and use it in GitHub Desktop.
Save wavebeem/fbd290165903d0a07813 to your computer and use it in GitHub Desktop.
ES6 modules export bindings, not values.
export let x = 1;
export function inc() {
x++;
};
import {x, inc} from "./foo";
console.log(x); // 1
inc();
console.log(x); // 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment