Closed specialunderwear closed 12 years ago
Hi are you going to review the patch?
Thanks for the pull request and sorry for making you wait this long.
That's a very clever idea you have here - it took me quite some time to really understand where the real value of it is. I have to think about this some more and see how to properly integrate it into Swiftsuspenders 2, though. That last part most likely means that I'll not take your pull request but implement the idea in a possibly slightly different way. In that case, I would of course add you to the contributors file, or, if you'd prefer that, I can also get back to you and give you directions to make the required changes yourself.
Hi, I'll gladly modify the patch to apply to swiftsuspenders 2, including any modifications you require. Please note that effectively, there are only 2 lines of code changed. The rest is all unit tests to demonstrate the use cases, which these very minor changes open up.
Ok, thanks for the offer. I will let you know once I'm ready to work with you on that. Might be a couple weeks, though.
Has this been explored further?
Yes, a bit. I will definitely include it in 2.0.
Yay!
So I finally got around to implementing this. Turned out to be pretty easy after all. I will have to do some performance analysis later on, but the impact shouldn't be major at all.
Sounds like a fun feature to blog about.
Which I absolutely plan on doing, yes. I hope to do a series of posts that I can then turn into some sort of cookbook/ specual features section for the docs.
If you liked that, maybe you want to check out: https://github.com/specialunderwear/as3-mixin which elaborates on the concept.
Hmm I think something is missing in the tests. The point of the original unit tests, is that the injected postconstruct handler, acts like a method and has access to 'this' which is properly bound to the unjection target. Somehow that got lost in translation. When i get access to my computer, I'll Try to add it to your current test suite.
See the last test: that verifies that the method is executed in the injectee's scope.
And thanks for the link to your mixin project. Very interesting indeed.
You're right, sorry.
Hi implemented a generalisation of the postconstruct meta tag. Currently it can only be used on methods. I adapted it to also work for function objects. This opens up the following use case:
Which means you can map and inject a postconstruct handler, before it is executed.