Code example for applying decorations asynchronously

Not really, but there’s not a lot to it. Start your request as appropriate (probably a debounce on document updates) from a view plugin. When it returns, dispatch a transaction with metadata that tells your state field to add the decorations. Either drop responses that are outdated, or record mappings in order to be able to map them to the updated document.