Repository Hub
The repository hub is used to send and receive events on the client, regarding workspace operations. Extends MessageHub.
- Module:
platform-core
- Source: service-repository/repository-hub.js
- Web Link:
/services/web/service-repository/repository-hub.js
- Status:
stable
- Group:
platform
Basic Usage
Include the hub using the web link above. If you are making a standard Dirigible editor, the repository hub is already included.
<script type="text/javascript" src="/services/web/service-repository/repository-hub.js"></script>
exampleView.controller('ExampleViewController', ($scope) => {
const repositoryHub = new RepositoryHub();
});
Functions
Function | Description | Returns |
---|---|---|
announceRepositoryModified(DataParams) | Sends a message containing information on which workspace has been changed. | - |
onWorkspaceChanged(handlerFunc) | Triggered when a workspace has been changed. | function |
Param definitions
Typedefs
- DataParams :
Object
Note
Params in square brackets are optional.
Params : Object
Param | Type | Description |
---|---|---|
data | Object.<any, any> |
Sends a message containing information on what has changed. |
Example
repositoryHub.announceRepositoryModified({
data: {
folderAdded: true;
}
});
const modifiedListener = repositoryHub.onFileSelected((data) => {
if (data.folderAdded) console.log('Folder has been added.');
});