Coder Social home page Coder Social logo

letoderea's People

Contributors

rf-tar-railt avatar

Stargazers

 avatar  avatar

letoderea's Issues

[Feature] 0.3更改

1.delegate层次上升,并作为事件接收主体
2.condition细化并下分给delegate,即在delegate接收事件后再执行condition;其次分为事件分发前与事件分发后
3.publisher外放,即不再作为es内部实体,而是作为“事件发起者”的概念,其实际用途应为对事件数据的说明或解释

Refactor Plan

  • 丢弃delegate,publisher内通过字典存储subscriber
  • 注册subscriber时会检查监听的event是否存在于某个已注册的publisher内,这要求publisher能给出其声明的event类型
  • event应由publisher主动或被动传入event bus中(主动指publisher内方法主动调用eb的event pub,被动指eb轮询其所有的publisher)
  • event 必须实现一个接受context的方法,作用是为context增加自己需要给出的参数。
  • 新增 Provider类,其通常只能绑定同种类型的参数,其需要实现根据传入的context给出相关类型的方法。其可以通过eb的全局,event类或者类默认值或者在注册subscriber装饰器内传入,并在注册时与监听函数每个参数进行绑定。一个参数可以绑定多个provider。绑定时依据类型或者provider指定的target。
  • Provider可以设置为wilcard/generic/subclass模式
    • wilcard 可以特别绑定包括未声明类型的所有参数,前提是该参数没有被绑定过;target可以限定其作用范围
    • generic 可以绑定其所有子类类型的参数
    • subclass 可以绑定其所有父类类型的参数 (不包括 object)
  • 若注册后仍有参数未绑定,则在参数注入阶段会依据context参数的类型进行判定
  • 修改辅助器
  • Depend重做

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.