debian-mirror-gitlab/app/assets/javascripts/mr_notes/init_count.js
2023-03-05 14:24:40 +05:30

13 lines
349 B
JavaScript

import store from '~/mr_notes/stores';
export function initOverviewTabCounter() {
const discussionsCount = document.querySelector('.js-discussions-count');
store.watch(
(state, getters) => getters.discussionTabCounter,
(val) => {
if (typeof val !== 'undefined') {
discussionsCount.textContent = val;
}
},
);
}