What is the correct way to set decorations asynchronously?

My decorations don’t seem to show up as I view.dispatch({ changes: [changes]}) which I’m trying to implement from 3rd party API calls, I am not sure if I am applying them properly. While the decoration examples in the documentation are super helpful they all seem to be event driven. How might I implement a change in decorations asynchronously? Like underlining the other person’s code in a collaborative session?


When your result comes back, fire a separate transaction with a state effect that informs some field or plugin about the annotations, which converts them to decorations.

Thank you. Got it working now.