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

Creating a list with the same model overwrites existing lists #171

Open
TomJLynch opened this issue Sep 11, 2018 · 1 comment
Open

Creating a list with the same model overwrites existing lists #171

TomJLynch opened this issue Sep 11, 2018 · 1 comment

Comments

@TomJLynch
Copy link
Member

In the load section for a form, I defined a list that I had already defined in the load section of the list. That overwrote the first list in the globals, causing bugs because various properties were undefined. It wasn't obvious that I did that. We should do something. Prevent it; allow it and log it; don't create a new list and just return the existing one?

@szul
Copy link
Member

szul commented Sep 11, 2018

Two possible options:

  • Log a warning to the console that a new list is potentially overwriting a previous list, and suggest passing in an ID to the form or list options.
  • Return an existing list or form from the globals, if it exists. This would allow you to create new scoped list or form objects inside of methods, but essentially act as a singleton for the page components.

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

No branches or pull requests

2 participants