all files / containers/Stars/ index.tsx

84.38% Statements 27/32
51.61% Branches 16/31
87.5% Functions 7/8
92.31% Lines 24/26
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39                             
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    Iif (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) Eif (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var React = require('react');
var stars_1 = require('../../redux/modules/stars/stars');
var connect = require('react-redux').connect;
var asyncConnect = require('redux-connect').asyncConnect;
var Stars = (function (_super) {
    __extends(Stars, _super);
    function Stars() {
        _super.apply(this, arguments);
    }
    Stars.prototype.render = function () {
        var stars = this.props.stars;
        return (React.createElement("div", null, stars.isFetching ? 'Fetching Stars' : stars.count));
    };
    Stars = __decorate([
        asyncConnect([{
                promise: function (_a) {
                    var dispatch = _a.store.dispatch;
                    return dispatch(stars_1.getStars());
                },
            }]),
        connect(function (state) { return ({ stars: state.stars }); })
    ], Stars);
    return Stars;
}(React.Component));
exports.Stars = Stars;