One of the most convenient things about AngularJS was the two-way binding. Would it be advisable to replicate that with a much smaller library like PubSubJS and not use AngularJS? Or, would that create many more events that PubSubJS is intended to handle?
For example, imagine a form app where you type a first name into an input and that publishes the firstName event. There is a subscriber for the name that add that to the page title and an <h2/>
at the top of the page. Then you select an option in the "Level of Education" select and it publishes "Masters Degree". Then a subscriber displays other inputs based on the value.
So that is a fairly simple example of course but could PubSubJS be used like that to build a more complex single-page app with might have been $scope.firstName
in AngularJS now just being the firstName
event with the value as a param? The benefits being that is a much small library and you have a much more fault-tolerant decoupling of the code but that would also mean that a lot of events are being fired. Another benefit of it would be that you could go back and later write something like a page interaction analytics module that tracks events without ever having to touch the original code.