Giter VIP home page Giter VIP logo

plasmolysis's Introduction

Plasmolysis Framework

欢迎使用 Plasmolysis 框架,该项目皆在探索同构开发新范式的可能性,致力于为新一代互联网应用提供高耦合业务场景的基础设施。

Welcome to the Plasmolysis framework. This project is exploring the possibility of isomorphic development of a new paradigm, and is committed to providing an infrastructure of highly coupled business scenarios for a new generation of Internet applications.

背景 / Background

该项目最初的项目名为 NickelCat,是我在高中时主持开发的一个实验项目。该项目在当时已有初步成果,但由于学业原因暂时冻结了一段时间,现已处于恢复进行开发的状态。

The project was originally named Nickelcat, and it's an experimental project developed by me in high school. Since the past, this project had preliminary results, but it was temporarily frozen for some time due to academic reasons. Now it has been in the state of resumption of development.

使用方法 / Usage

请先在您的机器上安装 Git 与 NodeJS。

Please install Git and NodeJS first.

在终端下克隆该项目 git clone https://github.com/langyo/plasmolysis

Clone the project in the terminal git clone https://github.com/langyo/plasmolysis.

进入项目目录,运行 npm iyarn(如果您的机器已经安装了 Yarn,推荐使用)。

Enter the project's folder, and run the command npm i or yarn (We recommend use Yarn if you have installed it).

TIP: 如果您的网络环境处于**大陆,可以使用该仓库下的 shell 脚本切换 NPM 源为淘宝镜像源,以加速依赖库下载过程。

https://github.com/langyo/cnpm-registry-helper

执行 npm run build 即可编译项目。

Run the command npm run build to compile the project.

plasmolysis's People

Contributors

langyo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

simon300000

plasmolysis's Issues

所以为什么不使用函数式的声明?

是为了省略一个await或者yield吗?

比如示例里的

onClickButton: [
  setState({ title: 'The dialog will open for 3s(3000ms) later!' }),
  wait(3000),
  createModel('guideDialog')
],

为什么不写成↓?

onClickButton: () => {
  setState({ title: 'The dialog will open for 3s(3000ms) later!' })
  wait(3000)
  createModel('guideDialog')
},

如果是为了省yield/async的话完全可以考虑写一个wrapper:

wait = wrap(ms => new Promise(f => setTimeout(f, ms)))

onClickButton: () => {
  setState({ title: 'The dialog will open for 3s(3000ms) later!' })
  wait(3000)
  createModel('guideDialog')
},

用数组的一个坏处是,这样的代码非常不直观(并且 callback hell):

      searchDb((payload) => ({ collection: 'users', payload }),
        [
          reply({ state: 'success' })
        ],
        [
          reply({ state: 'fail' })
        ]
      )

完全可以这样:

searchDb(payload => ({ collection: 'users', payload }))
  .then(() => reply({ state: 'fail' }))
  .catch(() => reply({ state: 'success' }))

(这样做也有坏处,比如不能用 try/catch,但是我感觉总比数组好一些……)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.