-
Notifications
You must be signed in to change notification settings - Fork 1
An Overview | HOC
HOC is a high-level component library. It implements preact internally and exposes API loosely coupled with the underlying library.
The core motivation behind building this library to write code for the future. Apply software fundamentals in UI engineering as well. Since ages, Separation of concerns was a backend thing, but this is no longer valid. UI logic has become so complex that the developer needs to focus a lot on software designs.
A complex UI application comprises the following actions:
- Making a call to remote service (REST endpoints)
- Manages authentication logic
- Handles errors based on error code sent by the remote system
- Handles complex UI layouts
- Takes care of the data aggregation
- Talks to different persistent storage like IDB
- Interacts with the third party systems like firebase etc
And the list goes on.
The conventional approach to developing a UI application would not be efficient. The developers need to ensure they separate data aggregation from layouts and remote calls from storage etc.
An evergrowing web app requires to manage its states at different levels such as component, page & application. However, at the top, all narrow down to the component level state with HOC Implementation.