chromium/third_party/blink/perf_tests/speedometer20/resources/todomvc/dependency-examples/flight/flight/app/js/ui/main_selector.js

/*global define */
'use strict';

define([
    'flight/lib/component'
], function (defineComponent) {
    function mainSelector() {
        this.toggle = function (e, data) {
            var toggle = data.all > 0;
            this.$node.toggle(toggle);
        };

        this.after('initialize', function () {
            this.$node.hide();
            this.on(document, 'dataStatsCounted', this.toggle);
        });
    }

    return defineComponent(mainSelector);
});