Repository URL to install this package:
|
Version:
0.9.5 ▾
|
/* 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 }