Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
view-container / dist / constructors / injectGlobal.js
Size: Mime:
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// @flow
const hash_1 = __importDefault(require("../vendor/glamor/hash"));
const StyleSheet_1 = __importDefault(require("../models/StyleSheet"));
exports.default = (stringifyRules, css) => {
    const injectGlobal = (...args) => {
        const styleSheet = StyleSheet_1.default.master;
        const rules = css(...args);
        const hash = hash_1.default(JSON.stringify(rules));
        const id = `sc-global-${hash}`;
        if (!styleSheet.hasId(id)) {
            styleSheet.inject(id, stringifyRules(rules));
        }
    };
    return injectGlobal;
};
//# sourceMappingURL=injectGlobal.js.map