telerik / mobile-cli-lib

Contains common infrastructure for CLIs - mainly AppBuilder, NativeScript, DDB and Proton.
Apache License 2.0
11 stars 10 forks source link

feat(livesync): execute all hooks #1045

Closed Mitko-Kerezov closed 6 years ago

Mitko-Kerezov commented 6 years ago

Instead of executing the first hook which tries to replace one of CLI's methods, execute them all in succession. Pass the a reference to the original CLI method to the first hook, then a reference to the first hook's function to the second and so on. This approach is inspired by objective-C's method swizzling and serves as a similar mechanism. Hooks should decide wether to call the original method or not.

Ping @rosen-vladimirov @KristianDD