Sha256: 8ed9471aed7c95972e9a248f16ea7f0abbbfdf2a1e82a4d71067cd21d8dd345d

Contents?: true

Size: 670 Bytes

Versions: 23

Compression:

Stored size: 670 Bytes

Contents

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const JasonContext_1 = __importDefault(require("./JasonContext"));
const react_1 = require("react");
function useSub(config, options = {}) {
    // useEffect uses strict equality
    const configJson = JSON.stringify(config);
    const subscribe = react_1.useContext(JasonContext_1.default).subscribe;
    react_1.useEffect(() => {
        // @ts-ignore
        return subscribe(config, options).remove;
    }, [configJson]);
}
exports.default = useSub;

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
jason-rails-0.8.7 client/lib/useSub.js
jason-rails-0.8.6 client/lib/useSub.js
jason-rails-0.8.4 client/lib/useSub.js
jason-rails-0.8.3 client/lib/useSub.js
jason-rails-0.8.2 client/lib/useSub.js
jason-rails-0.8.1 client/lib/useSub.js
jason-rails-0.7.5.1 client/lib/useSub.js
jason-rails-0.8.0 client/lib/useSub.js
jason-rails-0.7.5 client/lib/useSub.js
jason-rails-0.7.3 client/lib/useSub.js
jason-rails-0.7.2 client/lib/useSub.js
jason-rails-0.7.1 client/lib/useSub.js
jason-rails-0.7.0 client/lib/useSub.js
jason-rails-0.6.8 client/lib/useSub.js
jason-rails-0.6.7 client/lib/useSub.js
jason-rails-0.6.6 client/lib/useSub.js
jason-rails-0.6.5 client/lib/useSub.js
jason-rails-0.6.4 client/lib/useSub.js
jason-rails-0.6.3 client/lib/useSub.js
jason-rails-0.6.2 client/lib/useSub.js