// summary
Westore is an MVVM layered architecture designed specifically for mini programs, aiming to completely decouple business logic from the view layer through responsibility-driven design. By introducing a Store layer as an intermediary, the framework achieves high portability and code reusability for the Model. Developers do not need to operate setData directly, as they can simply call the update method to achieve efficient view updates through an internal diff mechanism.
// technical analysis
Westore is an MVVM layered architecture framework designed specifically for WeChat Mini Programs, aiming to solve the maintenance and scalability issues caused by business logic accumulation in Page/Component. By introducing Responsibility-Driven Design, it forces developers to encapsulate business logic within an independent Model layer, thereby achieving complete decoupling of business logic from the view layer. The architecture adopts the Mediator pattern, bridging View and Model through a Store layer, which not only improves code testability but also enables cross-platform reuse of the Model layer, allowing developers to seamlessly migrate core business logic to Web or other rendering environments.
// key highlights
// use cases
// getting started
Developers can integrate the framework into a Mini Program project using the command npm install westore --save. After installation, it is recommended to refer to the official westore-example or westore-example-ts sample code, organize business logic according to the Model-Store-Page layered structure, and manage page data and interactions by extending the Store class.