UNPKG

@42.nl/jarb-final-form

Version:
28 lines (27 loc) 617 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.configureConstraint = configureConstraint; exports.getConfig = getConfig; let config = null; /** * Configures the Constraint libary. * * @param {Config} c The new configuration */ function configureConstraint(c) { config = c; } /** * Either returns the a Config or throws an error when the * config is not yet initialized. * * @returns The Config */ function getConfig() { if (config === null) { throw new Error('The constraint service is not initialized.'); } else { return config; } }