question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I have the following problem using ResultT `import { BaseUseCase, IResultT, ResultT } from “./base/BaseUseCase” import { IPatientRepository, IPatient } from “@umahealth/repositories-module

export class FindPatientUseCase extends BaseUseCase { constructor(private readonly PatientRepository: IPatientRepository) { super() } async execute(uid: string, patient: IPatient): Promise<IResultT<IPatient>> { const result = new ResultT() const patientExists: IPatient = await this.PatientRepository.getByUid(uid) result.setData(patientExists, 200) return result } }`

it says Type 'Result<unknown>' is not assignable to type 'IResult<IPatient>'. Types of property 'data' are incompatible. Type 'unknown' is not assignable to type 'string | IPatient'. Type 'unknown' is not assignable to type 'IPatient'

I’m failling to understand how to properly use this library. Could you please give me some guidance?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gocandracommented, Sep 24, 2021

thanks! yeah, everything just fell into place afterwards. I was struggling at first with incorporating the whole framework into my head, but I fell that I’m now able to extract the most value out of this template. This is a very nice project, congrats!!

1reaction
gocandracommented, Sep 23, 2021

I’ve just solved it… ajjajajjaajaja sry to bother just for anyone else looking for this, you declare result like so. const result = new ResultT<IPatient>()

Read more comments on GitHub >

github_iconTop Results From Across the Web

Result Definition & Meaning - Merriam-Webster
The meaning of RESULT is to proceed or arise as a consequence, effect, or conclusion. How to use result in a sentence.
Read more >
RESULT | definition in the Cambridge English Dictionary
result meaning: 1. something that happens or exists because of something else: 2. because of something: 3. a good…. Learn more.
Read more >
Result Definition & Meaning - Dictionary.com
something that happens as a consequence; outcome. Mathematics. a quantity, expression, etc., obtained by calculation. Often results.
Read more >
RESULT (noun) definition and synonyms - Macmillan Dictionary
Definition of RESULT (noun): something caused by something else; score/name of winner; information obtained; mark in examination; success from ...
Read more >
Result definition and meaning | Collins English Dictionary
1. something that ensues from an action, policy, course of events, etc; outcome; consequence ; 2. a number, quantity, or value obtained by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found