Skip to content

Instantly share code, notes, and snippets.

@shin1x1
Last active November 14, 2018 09:26
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 shin1x1/f61266c74941c3f592d2c8a03797c4cc to your computer and use it in GitHub Desktop.
Save shin1x1/f61266c74941c3f592d2c8a03797c4cc to your computer and use it in GitHub Desktop.
console.log('counter loading...');
const counter = {
no: 0
};
export default counter;
import counter1 from './counter';
counter1.no++;
console.log('counter1:' + counter1.no);
console.log('counter2:' + counter2.no);
import counter2 from './counter';
counter2.no++;
console.log('counter1:' + counter1.no);
console.log('counter2:' + counter2.no);
@shin1x1
Copy link
Author

shin1x1 commented Nov 14, 2018

counter loading...
counter1:1
counter2:1
counter1:2
counter2:2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment