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

Refactor background layout computation code #23

Open
gauravgrover95 opened this issue Aug 11, 2018 · 0 comments
Open

Refactor background layout computation code #23

gauravgrover95 opened this issue Aug 11, 2018 · 0 comments

Comments

@gauravgrover95
Copy link
Contributor

Code written in #22 is good enough to make things work. But to make it crisp, easy to understand and more DRY. We can

  • use a single worker file (can be named wrapper.worker.js file)
  • import every layout computation file in it
  • Transfer the switch case statement from layout.js file to wrapper worker file to decide which layout to use

Although this is not the super best technique to do this because there will be two entry files into the layout computation. One will be layout.js and the other will be wrapper.worker.js.

A much more advanced version of doing this would be to even merge those two files into one if it does not make the code super-complicated.

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