Home  >  Q&A  >  body text

javascript - When refactoring, the original object becomes a js module (js file), so how should the previously bound events be written now?

Refactor the old code, modularize it, and split a large js file into many js files. The original namespace object has been split into js files. So where should the events that were previously bound to the object be bound now? Is it written as a function and can be called when an event is triggered?

高洛峰高洛峰2642 days ago656

reply all(1)I'll reply

  • 学习ing

    学习ing2017-06-30 10:01:03

    I don’t quite understand the question, but do you think the observer pattern is feasible?

    reply
    0
  • Cancelreply