Created
June 22, 2016 05:03
-
-
Save maxehnert/578bba99c822ba2c50c62ce86f921902 to your computer and use it in GitHub Desktop.
es6 cyclic dependency add.js
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
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