Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promised Observable #475

Open
balbatross opened this issue Jun 19, 2023 · 1 comment · May be fixed by #476
Open

Promised Observable #475

balbatross opened this issue Jun 19, 2023 · 1 comment · May be fixed by #476

Comments

@balbatross
Copy link

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.

@balbatross balbatross linked a pull request Jun 19, 2023 that will close this issue
@linonetwo
Copy link

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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants