Skip to content

Instantly share code, notes, and snippets.

@maxehnert
Created June 22, 2016 05:03
Show Gist options
  • Save maxehnert/578bba99c822ba2c50c62ce86f921902 to your computer and use it in GitHub Desktop.
Save maxehnert/578bba99c822ba2c50c62ce86f921902 to your computer and use it in GitHub Desktop.
es6 cyclic dependency add.js
import { subtractfn, countSubtract } from './subtract';
export var countAdd = 0;
export function add(n = 0) {
countAdd++;
console.log('countAdd', countAdd);
countSubtract++;
console.log('countSubtract from add file', countSubtract);
if (n < 20) return subtractfn(n + 1);
}
subtractfn(countAdd);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment