Creating a Tooltip to add Signature Help using LSP

I have created a language client using CodeMirror to connect to a language server via LSP. I need to add signature help as a feature and am following the example guide on creating a tooltip. The problem is, that since I am retrieving information on signature help via websocket, my method for retrieving such information returns a Promise and I cannot use this in conjunction with how a tooltip is set up as an extension, since I must return a Tooltip[] and not a Promise<Tooltip>[]. Is there a way I can render a tooltip on the view differently? In particular, I want to manipulate the view in the .then() on the Promise.

The general approach would be to start the promise in an update listener or view plugin, and when it comes back, verify that it is still useable (the editor state didn’t change in ways that make it inappropriate for the current state), and dispatch a transaction that updates some state field so that it displays your tooltip.

Can you explain exactly what you mean by “dispatch a transaction that updates some state field”? Do I have to define a StateField similar to the guide on how to create a Cursor Tooltip? Or should I do something like this:

const tooltip = { ... } // build tooltip
let transaction = this.view.state.update(<do something here with tooltip ???>);
this.view.dispatch(transaction);

I am doing all this in an update listener of a PluginValue