Frequently, users will have components that might want to share or synchronize data. A typical capital markets use case would be to link several components together so that they share the same stock symbol. Changing the stock symbol in one component would cause the other components to also change their symbol. In this case, we would call the symbol a "linkage."

To enable the Linker for a particular component add foreign['Window Manager'].showLinker = true to its component config.

Components must register themselves as linkable and specify linkage types. This registration and communication between components occurs automatically over the Finsemble Router via FSBL.Clients.LinkerClient. The Linker Client handles interfacing with the router so that you can focus on passing and receiving linked information.

Links are unique to the group and data type. Linkages are saved in the component's state.

Using The Linker

Item 1 in the image below shows the Linker icon along with a group that this component has joined. Groups are demarcated by colors—this component is in the yellow group. Groups are added or removed when a user clicks on a group in the Linker window.

Item 2 shows the Linker window and a list of colors that represent different Linker groups. By default, if a component joins a group, it will receive all messages for that group.

To transmit data to other components, simply call FSBL.Clients.LinkerClient.publish whenever you want to send out an update. This will transmit the given data to all groups that the current component has joined.

    //To send data through the linker.This will send a `symbol` object with the symbol 'AAPL` to
    //any components that is in the same group that is listening for `symbol`

To receive data from other components through the Linker Client, you'll need to subscribe to a specific topic.

   FSBL.Clients.LinkerClient.subscribe("symbol", function(data){ // Symbol is the data type
        //Do something with data. Data would be "AAPL" in this case.

Further reading

Advanced information about linking can be found in the Linker Client documentation.

The Linker Client automatically shares data between windows based on linkage. A user can also use the Drag and Drop Client to share data. Check out Drag and Drop Sharing for more information.