How to use is-function - 8 common examples

To help you get started, we’ve selected a few is-function 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 barbuza / kebakaran / src / FirebaseStruct.js View on Github external
constructor(fields, mapValue = mapValueIdent) {
    Object.keys(fields).forEach(name =>
      invariant(isEmitter(fields[name]), 'FirebaseStruct fields values must be emitters')
    );

    invariant(isFunction(mapValue), 'FirebaseStruct second arg must be a function');

    super();

    this.fields = fields;
    this.mapValue = mapValue;

    this.reset();
  }
github barbuza / kebakaran / src / FirebaseList.js View on Github external
constructor(ref, mapChild, { idField = 'id', instant = true, mapKey = getKey } = {}) {
    invariant(isEmitter(ref), 'FirebaseList first arg must be emitter');
    invariant(isFunction(mapChild), 'FirebaseList second arg must be a function');
    invariant(isFunction(mapKey), 'FirebaseList `mapKey` option must be a function');

    super();

    this.ref = ref;
    this.mapChild = mapChild;
    this.idField = idField;
    this.instant = instant;
    this.hasInitialData = !instant;
    this.mapKey = mapKey;

    this.reset();
  }
github GameDistribution / GD-HTML5 / src / components / VideoAd.js View on Github external
_getInnerErrorCode(error) {
    if (!isFunction(error.getInnerError)) return;

    let innerError = error.getInnerError();
    if (!innerError) return;

    if (
      isFunction(innerError.getErrorCode) &&
      isFunction(innerError.getVastErrorCode)
    )
      return (
        innerError.getErrorCode().toString() ||
        innerError.getVastErrorCode().toString()
      );

    return innerError.message;
  }
github barbuza / kebakaran / src / sagaCb.js View on Github external
function flush() {
    if (nextData !== NO_VALUE && !isEqual(nextData, lastData) && isFunction(nextCallback)) {
      [callbackCopy, nextCallback, lastData, nextData] = [nextCallback, null, nextData, NO_VALUE];
      callbackCopy(null, lastData);
    }
  }
github paypal / glamorous / src / theme-provider.js View on Github external
getTheme(passedTheme) {
    const theme = passedTheme || this.props.theme
    if (isFunction(theme)) {
      const mergedTheme = theme(this.outerTheme)
      if (!isPlainObject(mergedTheme)) {
        throw new Error(
          '[ThemeProvider] Please return an object from your theme function, ' +
            'i.e. theme={() => ({})}!',
        )
      }
      return mergedTheme
    }
    return {...this.outerTheme, ...theme}
  }
github styled-components / styled-components / src / models / ThemeProvider.js View on Github external
getTheme(passedTheme: (outherTheme: Theme) => void | Theme) {
    const theme = passedTheme || this.props.theme
    if (isFunction(theme)) {
      const mergedTheme = theme(this.outerTheme)
      if (!isPlainObject(mergedTheme)) {
        throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!')
      }
      return mergedTheme
    }
    if (!isPlainObject(theme)) {
      throw new Error('[ThemeProvider] Please make your theme prop a plain object')
    }
    return { ...this.outerTheme, ...(theme: Object) }
  }
github GameDistribution / GD-HTML5 / src / components / VideoAd.js View on Github external
_getInnerErrorCode(error) {
    if (!isFunction(error.getInnerError)) return;

    let innerError = error.getInnerError();
    if (!innerError) return;

    if (
      isFunction(innerError.getErrorCode) &&
      isFunction(innerError.getVastErrorCode)
    )
      return (
        innerError.getErrorCode().toString() ||
        innerError.getVastErrorCode().toString()
      );

    return innerError.message;
  }
github barbuza / kebakaran / src / FirebaseList.js View on Github external
constructor(ref, mapChild, { idField = 'id', instant = true, mapKey = getKey } = {}) {
    invariant(isEmitter(ref), 'FirebaseList first arg must be emitter');
    invariant(isFunction(mapChild), 'FirebaseList second arg must be a function');
    invariant(isFunction(mapKey), 'FirebaseList `mapKey` option must be a function');

    super();

    this.ref = ref;
    this.mapChild = mapChild;
    this.idField = idField;
    this.instant = instant;
    this.hasInitialData = !instant;
    this.mapKey = mapKey;

    this.reset();
  }

is-function

is that thing a function? Use this module to find out

MIT
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis

Popular is-function functions