Spaces:
Sleeping
Sleeping
| from channels.channel import Channel | |
| from entities.entity import Entity | |
| from interactors.interactor import Interactor | |
| from presenters.presenter import Presenter | |
| from routers.router import Router | |
| from components.view import View | |
| from type import TYPES | |
| def initialize_app(): | |
| # Tạo các thành phần | |
| channel = Channel() | |
| entity = Entity() | |
| interactor = Interactor(channel, entity) | |
| presenter = Presenter(channel) | |
| router = Router(channel) | |
| view = View(channel) | |
| # Xử lý các sự kiện từ người dùng | |
| presenter.handle('render') | |
| presenter.handle('create', 'sampleKey', 'sampleValue') | |
| presenter.handle('read', 'sampleKey') | |
| presenter.handle('update', 'sampleKey', 'updatedValue') | |
| presenter.handle('delete', 'sampleKey') | |
| # Điều hướng | |
| router.navigate('Home') | |
| if __name__ == "__main__": | |
| initialize_app() |