0

The problem is I want to assign a value on a observable type interface. But I don't know how to do that.

export interface LocalConsultationCachingModel {
  cache: ConsultationModel[];
  httpPromise: Observable<ConsultationModel[]>;
}

I want to assign on httpPromise: Observable<ConsultationModel[]>; }

1
  • What do you want to achieve ? Assign an array to httpPromise ? Commented Aug 2, 2019 at 9:52

1 Answer 1

1

To set value to an observable you can just use of operator from RxJS. It'll emit your value then emits a complete notification.

let localConsultation : LocalConsultationCachingModel = {
   cache: [...],
   httpPromise: of([...])
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.