Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

309
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!