superdesk/superdesk-client-core

View on GitHub
scripts/apps/dashboard/services/DashboardWidgets.ts

Summary

Maintainability
A
0 mins
Test Coverage
import _ from 'lodash';

export function DashboardWidgets() {
    var privateWidgets = {};

    this.addWidget = function(id, widget, debug) {
        privateWidgets[id] = _.extend({_id: id}, widget);
    };

    this.$get = function() {
        return _.values(privateWidgets);
    };
}