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

Rework add_data #6

Open
CaptainN opened this issue Jul 16, 2013 · 0 comments
Open

Rework add_data #6

CaptainN opened this issue Jul 16, 2013 · 0 comments

Comments

@CaptainN
Copy link
Member

The method for setting the data of the OnceForm does two different things, and that is confusing. Figure out a better way.

  1. If you don't set the second param, OnceForm will polyfill the data array and set all fields from the data array (including ones marked as non-enumerable or private).
  2. If you set the second param false, OnceForm will only set public (enumerable) fields.

The second behavior is probably what you expect when you invoke this method directly. OnceForm will automatically invoke the method the first way, when it detects a post back has occurred. The first behavior is currently the default.

Suggestion: separate the two behaviors in two methods to make it clearer.

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