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

318
Visualizações
What does () mean if set as a interface property?

In the Vue.js source code (packages/reactivity/src/effects.ts), I found this:

export interface ReactiveEffectRunner<T = any> {
  (): T
  effect: ReactiveEffect
}

What does () mean in the code?

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

0

When you want to define a function with other properties you make use of this pattern.

() means that the object implementing this interface will be a function which can be called and does not need any params.

effect means it has another property called effect.

An example from the docs:

type DescribableFunction = {
  description: string;
  (someArg: number): boolean;
};
function doSomething(fn: DescribableFunction) {
  console.log(fn.description + " returned " + fn(6));
}

Read about call signatures

about 4 years ago · Juan Pablo Isaza Relatório

0

It means the type is executable as a function.

for example:

declare const fn: ReactiveEffectRunner<{ abc: number }>

const result = fn() // { abc: number }
fn.effect // ReactiveEffect

Playground

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