Skip to content

Rework add_data #6

@CaptainN

Description

@CaptainN

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions