# Emitter for input change in behaviour

**URL:** <https://discourse.nodered.org/t/emitter-for-input-change-in-behaviour/26425>\
**Category:** Developing Nodes\
**Created:** [10 May 2020 12:31 UTC](https://discourse.nodered.org/t/emitter-for-input-change-in-behaviour/26425 "2020-05-10T12:31:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterprib](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/peterprib/32/6974_2.png) [@peterprib](https://discourse.nodered.org/u/peterprib)\
**Post date:** [10 May 2020 12:31 UTC](https://discourse.nodered.org/t/emitter-for-input-change-in-behaviour/26425/1 "2020-05-10T12:31:45Z")

</div>

Prior to v1 my code to put a wrapper on an input emitter to trap a message before an node processed the message. With the new version node.listeners('input') returns no events when it is runs. The wrappers are applied on "nodes-started". Wondering why and how can I make my wrapper logic worked. Us a wrapper to control flow and get timing information. Plus thinking of using the technique for dynamic debugging.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 May 2020 12:44 UTC](https://discourse.nodered.org/t/emitter-for-input-change-in-behaviour/26425/2 "2020-05-10T12:44:51Z")

</div>

Unfortunately you havent provided nearly enough info (or a code example) for me to be of much use to you - but something tells me your issue is _possibly_ related to msg cloning by default.

use

```auto
node.send(msg,false);
return null;

```

instead of

```auto
return msg;

```

[Reference](https://nodered.org/docs/user-guide/writing-functions#sending-messages-asynchronously)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [10 May 2020 13:29 UTC](https://discourse.nodered.org/t/emitter-for-input-change-in-behaviour/26425/3 "2020-05-10T13:29:14Z")

</div>

Can you link to your code so we can see what you mean? There were a number of changes in 1.0 for the async message handling that would have modified how these internal APIs worked.

We have plans for a proper flow debugger, but its predicated on the Pluggable Message routing feature - which would be the _public_ api for inserting code into the messaging path. It's a feature that's very high on my personal wish list, but not currently top of the prioritisation.

---

<div class="post-metadata">

**Author:** ![peterprib](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/peterprib/32/6974_2.png) [@peterprib](https://discourse.nodered.org/u/peterprib)\
**Post date:** [11 May 2020 01:19 UTC](https://discourse.nodered.org/t/emitter-for-input-change-in-behaviour/26425/4 "2020-05-11T01:19:17Z")

</div>

One example of my code problem can be found in [https://github.com/peterprib/node-red-contrib-queuemanager](https://github.com/peterprib/node-red-contrib-queuemanager). queueManager.js is the driver and the RED.events.on("nodes-started" builds does the wrappers for input. Have a correct version for some of the issues caused by 1.0 but can't get pass base issue of emitter not listing anyl events.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 July 2020 01:19 UTC](https://discourse.nodered.org/t/emitter-for-input-change-in-behaviour/26425/5 "2020-07-10T01:19:20Z")

</div>

Closed on 10 July 2020 01:19 UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
