vendredi 14 janvier 2022

What resolve is doing in this situation?

New to ember, I am having trouble making sense of this code:

On the front-end, is a simple form, that is used to submit user text input as feedback

      <Form @onSubmit=>

          <TextField
            @multiline=3
            @placeholder="Additional comments"
            @autoFocus=
            @value=
            @disabled=
            @onChange=
          />

          <ButtonGroup>
            <Button
              @text="Send feedback"
              @loading=
              @onClick=
            />

            <Button
              @text="Cancel"
              @plain=true
              @onClick=
            />
          </ButtonGroup>
      </Form>

Backing it up, on the .js Component I have:

export default class FeedbackFormComponent extends Component {
  /**
   * Callback when the feedback form is submitted
   * Provides `feedbackText` and `wasContentUseful`
   * as arguments.
   *
   * @type {Function}
   * @public
   */
  onSubmitFeedback = resolve;

  @dropTask
  submitFeedback = function* submitFeedback() {
    let { feedbackText, wasContentUseful, onSubmitFeedback } = this;
    yield onSubmitFeedback(wasContentUseful, feedbackText);
  };

}

How can I track, what this submission is actually doing? What is resolve doing in a situation like this? onSubmitFeedback = resolve;




Aucun commentaire:

Enregistrer un commentaire