Skip to content

Promised Observable #475

Open
Open

Description

@balbatross

Kia Ora,

We're trying to run an async function that returns an observable, because of the structure of the resultType the library tries to serialize our Observable function leading to a DataCloneError.

Would a promised-observable resultType cause confusion? Happy to put the time in for a PR.

Activity

  1. linonetwo commented on Jul 17, 2023

    @linonetwo

    Try iife, like what we do in useEffect

    function runLLama(
      options: { conversationID: string; modelPath: string; openDebugger?: boolean; prompt: string },
    ): Observable<ILanguageModelWorkerResponse> {
    
      return new Observable<ILanguageModelWorkerResponse>((subscriber) => {
        void (async function runLLamaObservableIIFE() {
          await xxx
        })();
      });
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions