What is the right way to wire together 2 javascript objects?

前端 未结 6 1910
梦如初夏
梦如初夏 2020-12-28 19:34

I\'m currently facing a conundrum: What is the right way to wire together 2 javascript objects?

Imagine an application like a text editor with several different fi

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-28 20:05

    I have a inversion of control library for javascript, I'm pretty happy with it. https://github.com/fschwiet/jsfioc. It also supports events, so if you want to have a startup event thats fine. It could use more documentation...

    http://github.com/fschwiet/jsfioc

    Another (newer?) option, which has better documentation and support, is requireJS (http://requirejs.org/).

提交回复
热议问题