Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

delogic

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

delogic

一种 UI & 逻辑分离的编程设计思路。

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

delogic

一种 UI & 逻辑分离的编程设计思路。

  • UI 层仅依赖 Service,基本上为纯 UI 组件
  • Service 代码只依赖 DAO 的 interface,不依赖具体 DAO 实现,TodoService

image

Quick Start

$ git clone git@gitlab.alibaba-inc.com:pipe/delogic.git
$ cd delogic
$ lerna bootstrap
$ cd packages/todo-page && npm run dev

Online Demo

todolist

Principle

  • UI
    • 【允许】和 DOM、Service 交互
    • 【禁止】直接和 DAO 做数据交互
    • 【允许】自身组件的临时存储和状态,但不应过于复杂
  • Service
    • 【禁止】和 DOM 交互,任何 document.querySelector 都不允许
    • 【禁止】任何(除 DAO 外的)IO 交互,包括网络 IO(fetch)、本地 IO(localStorage)
    • 【允许】和 DAO 交互,所有 IO 都通过 DAO 接口
  • DAO Interface
    • 【仅】做数据模型定义,即模型字段的定义
  • DAO Implement
    • 【禁止】和 DOM 交互

FAQs

Package last updated on 05 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc