diff --git a/timesketch/frontend-v3/package.json b/timesketch/frontend-v3/package.json index 078620c10b..930256b878 100644 --- a/timesketch/frontend-v3/package.json +++ b/timesketch/frontend-v3/package.json @@ -14,7 +14,8 @@ "roboto-fontface": "*", "vue": "^3.4.31", "vuetify": "^3.6.11", - "axios": "^1.7.7" + "axios": "^1.7.7", + "tiny-emitter": "^2.1.0" }, "devDependencies": { "@vitejs/plugin-vue": "^5.0.5", diff --git a/timesketch/frontend-v3/src/event-bus.js b/timesketch/frontend-v3/src/event-bus.js new file mode 100644 index 0000000000..66ca6c8ba8 --- /dev/null +++ b/timesketch/frontend-v3/src/event-bus.js @@ -0,0 +1,23 @@ +/* +Copyright 2024 Google Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +import emitter from 'tiny-emitter/instance' + +export default { + $on: (...args) => emitter.on(...args), + $once: (...args) => emitter.once(...args), + $off: (...args) => emitter.off(...args), + $emit: (...args) => emitter.emit(...args) +} diff --git a/timesketch/frontend-v3/src/views/Sketch.vue b/timesketch/frontend-v3/src/views/Sketch.vue index ac80c4c6af..7d0d60cc2b 100644 --- a/timesketch/frontend-v3/src/views/Sketch.vue +++ b/timesketch/frontend-v3/src/views/Sketch.vue @@ -20,6 +20,7 @@ limitations under the License.