Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

131
Visualizações
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={{perform this.submitFeedback}}>

          <TextField
            @multiline={{3}}
            @placeholder="Additional comments"
            @autoFocus={{not @shouldRenderOptions}}
            @value={{this.feedbackText}}
            @disabled={{this.submitFeedback.isRunning}}
            @onChange={{action (mut this.feedbackText)}}
          />

          <ButtonGroup>
            <Button
              @text="Send feedback"
              @loading={{this.submitFeedback.isRunning}}
              @onClick={{perform this.submitFeedback}}
            />

            <Button
              @text="Cancel"
              @plain={{true}}
              @onClick={{action @onCancel}}
            />
          </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;

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Looks like that is referencing a function that acts like Promise.resolve, according to the documentation.

The referenced function has this signature, where it also takes in 2 arguments like onSubmitFeedback does:

resolve (value, label)

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda