Shopify/batman — Issue #212: onParseExit never gets cleaned up
Author: pvande
Created: 2011-11-04 22:03:47+00:00
State: open

I've solved this locally by redefining `$onParseExit` thusly:

``` coffee
onParseExit: $onParseExit = (node, callback) ->
set = Batman.data(node, 'onParseExit') || Batman.data(node, 'onParseExit', new Batman.SimpleSet)
if callback?
set.add callback
else
Batman.removeData(node, 'onParseExit')
return set
```

(The only times `$onParseExit` is called without a callback from inside Batman is when the callbacks are being consumed; I cannot promise this does not have unintended consequences.)