How to use the esp-js.Guard.isFunction function in esp-js

To help you get started, we’ve selected a few esp-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github esp / esp-js / packages / esp-js-ui / src / ui / regions / regionManager.ts View on Github external
public registerRegion(regionName: string, onAddingViewToRegionCallback: ViewCallBack, onRemovingFromRegionCallback: ViewCallBack) {
        Guard.stringIsNotEmpty(regionName, 'region name required');
        Guard.isFunction(onAddingViewToRegionCallback, 'onAddingViewToRegionCallback must be a function');
        Guard.isFunction(onRemovingFromRegionCallback, 'onRemovingFromRegionCallback must be a function');

        _log.debug('registering region {0}', regionName);
        if (this._regions[regionName]) {
            let message = `Cannot register region ${regionName} as it is already registered`;
            _log.error(message);
            throw new Error(message);
        }
        this._regions[regionName] = {
            onAdding: onAddingViewToRegionCallback,
            onRemoving: onRemovingFromRegionCallback
        };
    }
github esp / esp-js / packages / esp-js-ui / src / ui / regions / regionManager.ts View on Github external
public registerRegion(regionName: string, onAddingViewToRegionCallback: ViewCallBack, onRemovingFromRegionCallback: ViewCallBack) {
        Guard.stringIsNotEmpty(regionName, 'region name required');
        Guard.isFunction(onAddingViewToRegionCallback, 'onAddingViewToRegionCallback must be a function');
        Guard.isFunction(onRemovingFromRegionCallback, 'onRemovingFromRegionCallback must be a function');

        _log.debug('registering region {0}', regionName);
        if (this._regions[regionName]) {
            let message = `Cannot register region ${regionName} as it is already registered`;
            _log.error(message);
            throw new Error(message);
        }
        this._regions[regionName] = {
            onAdding: onAddingViewToRegionCallback,
            onRemoving: onRemovingFromRegionCallback
        };
    }