Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency cycle detected import/no-cycle #151

Open
SarvarKh opened this issue Jun 6, 2021 · 0 comments
Open

Dependency cycle detected import/no-cycle #151

SarvarKh opened this issue Jun 6, 2021 · 0 comments

Comments

@SarvarKh
Copy link

SarvarKh commented Jun 6, 2021

The requirement of the project is to separate DOM from logic in different files.
Thus, I have these files:

default.js

import { submitForm } from './logic'

function displayTaskForm(key) {
  // function create form HTML content with btn submit.
  submitForm(addTaskbtn, key);
  return form;
}

export { displayTable };

logic.js

import { displayTable } from './default';

const submitForm = (btn, key) => {
  // Adds event listener to add input to the table && local storage
  displayTable(key) // shows the table content including recent input
  return btn;
}

export { submitForm };

And I have these errors:

default.js
1:1 error Dependency cycle detected import/no-cycle

logic.js
1:1 error Dependency cycle detected import/no-cycle

Could you advise how I could solve this issue? the problem is I have to split my DOM from the logic part. I don't see a way to link creating DOM based on if statement results.

Here is the original repository link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant