Sep 9, 2018 · 1 min read
This is great guide but I’d like to suggest you some improvements.
Why do you call handleVisibilityChange in forceVisibleTrue when you can call only setVisibility method. It would mean less code in the event handler and more importantly it would be only event handler triggered only by an event.
Another improvement in this code may be done by exporting from API helper only function that receives the listener. And it would handle even the forcing the change internally. This would mean to move the logic from the manager into the helper. But you would have the complete API that can be used everywhere.
