Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
broadcast.subscribe(({ type, state, schema, ...others }) => {
if (type !== 'submit' && type !== 'reset') {
if (initialized) {
if (options.selector) {
if (
(isFn(options.selector) && options.selector({ type, state })) ||
(isArr(options.selector) &&
options.selector.indexOf(type) > -1) ||
(isStr(options.selector) && options.selector === type)
) {
setState({
status: type,
state,
schema,
...others
})
}
}
} else {
finalValue = {
status: type,
state,
schema,
...others
}
export const isNotEmptyStr = (str: string): boolean => !!(isStr(str) && str)