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

State object instead of module states #2835

Open
saschanaz opened this issue Apr 14, 2020 · 0 comments
Open

State object instead of module states #2835

saschanaz opened this issue Apr 14, 2020 · 0 comments

Comments

@saschanaz
Copy link
Collaborator

From #2832:

I really don't want more module level state variables 1) as they are major blockers against #2187 as those variables only initialize once and 2) it makes harder to track how modules depends on others. Modules should ideally only export functions and constants, not variables.

I guess 2) is hard to solve in current code structure though, but maybe we can create a new object to save states and pass it instead of current conf to at least make modules more modularized:

const respecDoc = {
  configuration, // current conf
  possibleExternalLinks,
  /* ... other states that can change during module runs ... */
};
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