tormjens / eventy

WordPress-like actions and filters for Laravel
422 stars 48 forks source link

How to remove a Anonymous callable action #16

Closed zotopteam closed 5 years ago

zotopteam commented 5 years ago

When i add a action: Eventy::addAction('foo', function() { echo 'bar'; });

Then I want to remove it, How to do this?

Eventy::remove('foo', ……);

tormjens commented 5 years ago

Good question. The function is anonymous so you wouldn't have a reference to it to remove it later on.

I'll try and come up with a solution for your issue. I'll get back to you!

tormjens commented 5 years ago

@zotopteam I've implemented functionality for this with #17. Mind giving it a go?

zotopteam commented 5 years ago

Thanks, #17 is pretty!