# Plugin apply returning object

**URL:** <https://discuss.prosemirror.net/t/plugin-apply-returning-object/744>\
**Category:** Uncategorized\
**Created:** [April 19, 2017, 10:57pm UTC](https://discuss.prosemirror.net/t/plugin-apply-returning-object/744 "2017-04-19T22:57:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kofifus](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/kofifus/32/288_2.png) [@kofifus](https://discuss.prosemirror.net/u/kofifus)\
**Post date:** [April 19, 2017, 10:57pm UTC](https://discuss.prosemirror.net/t/plugin-apply-returning-object/744/1 "2017-04-19T22:57:12Z")

</div>

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

However in [Break down text into sentences without changing schema](https://discuss.prosemirror.net/t/break-down-text-into-sentences-without-changing-schema/692/5) (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!

---

<div class="post-metadata">

**Author:** ![mikeb](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@mikeb](https://discuss.prosemirror.net/u/mikeb)\
**Post date:** [May 15, 2017, 12:49pm UTC](https://discuss.prosemirror.net/t/plugin-apply-returning-object/744/2 "2017-05-15T12:49:30Z")

</div>

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.
