Skip to content

Instantly share code, notes, and snippets.

@iam-peekay
Last active Oct 2, 2017
Embed
What would you like to do?
// lib/counter.js
export let counter = 1;
export function increment() {
counter++;
}
export function decrement() {
counter--;
}
// src/main.js
import * as counter from '../../counter';
console.log(counter.counter); // 1
counter.increment();
console.log(counter.counter); // 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment