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    
Size: Mime:
/* eslint-disable brace-style */
import { isBoolean, isObj, isFunction } from 'exotic'
// why on earth was this added and only used in checkbox...
function toIsSelected(component): boolean {
  const { state, dynamicState } = component.props

  if (isObj(dynamicState) && isBoolean(dynamicState.isSelected)) {
    return dynamicState.isSelected
  }
  // skeptical that component is ever called...
  // probably is in 1 place for formhandler
  else if (isObj(component.state) && isBoolean(component.state.isSelected)) {
    return component.state.isSelected
  }
  // should not need ^ above, it adds issues with primitives
  else {
    return component.props.isSelected
  }
}

export { toIsSelected }