Plugin apply returning object

In the ref, plugin state apply method needs to return a transaction

However in Break down text into sentences without changing schema (which works) the apply method returns an object: return {deco: DecorationSet.create(state.doc, [deco])}

I’m confused here … how does this work ?

thank you!

Guessing you’ve figured this out by now, but the state::apply method returns a “T”, which is shorthand for “a value of type <T>, where <T> is the consistent type of the value in question”. Basically, state is a template-ish construct, and this is a template method within it. The value being manipulated can be any type as long as it has consistent across calls for a specific plugin.