Skip to content
Snippets Groups Projects
Commit 8dee69e4 authored by Jörg Richter's avatar Jörg Richter
Browse files

Extend Topicmap Panel protocol: `updateTopic()`, `updateAssoc()`

parent 2f40f3e7
No related branches found
No related tags found
No related merge requests found
Pipeline #14815 passed
......@@ -55,6 +55,12 @@ const actions = {
_processDirectives (_, directives) {
directives.forEach(dir => {
switch (dir.type) {
case 'UPDATE_TOPIC':
updateTopic(new dmx.Topic(dir.arg))
break
case 'UPDATE_ASSOC':
updateAssoc(new dmx.Assoc(dir.arg))
break
case 'DELETE_TOPIC':
deleteTopic(dir.arg.id)
break
......@@ -186,6 +192,22 @@ function getTopicmap (id, dispatch) {
// Process directives
function updateTopic (topic) {
// update state
Object.keys(topicmapCache).forEach(topicmapId => {
topicmapCache[topicmapId].updateTopic(topic)
})
// Note: the view is updated by the particular renderer
}
function updateAssoc (assoc) {
// update state
Object.keys(topicmapCache).forEach(topicmapId => {
topicmapCache[topicmapId].updateAssoc(assoc)
})
// Note: the view is updated by the particular renderer
}
/**
* Processes a DELETE_TOPIC directive.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment