Connector

Lets your modules stay in touch with each other.

Modules are intended to be modular and therefore to work on their own. So why do we need to connect our modules with each other?

Concept

TerrificJS modules most often have a visual counterpart that – due to the nature of frontend – necessarily has to be rectangular. So sometimes you will have to split up a functionality across multiple modules.

Thinking of filtering of e.g. twitter messages, you could have a module Messages for displaying the messages and another module Filter for selecting the appropriate filters. Additionally this helps you to keep modules simple and to split the complexity in smaller parts.

Regarding the implementation of connectors, everything you need to know has already been covered elsewhere.

  • In the Conventions chapter you learn how to connect your modules with each other by using the HTML5 data attribute.
  • Alternatively could also establish your connections manually by using subscribe/unsubscribe
  • The Module chapter introduces you the fire method that serves you as communication device to stay in touch with your connected modules.
Close