Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function put(channel, action) {
if (process.env.NODE_ENV !== 'production') {
if (arguments.length > 1) {
check(channel, is.notUndef, 'put(channel, action): argument channel is undefined')
check(channel, is.channel, `put(channel, action): argument ${channel} is not a valid channel`)
check(action, is.notUndef, 'put(channel, action): argument action is undefined')
} else {
check(channel, is.notUndef, 'put(action): argument action is undefined')
}
}
if (is.undef(action)) {
action = channel
// `undefined` instead of `null` to make default parameter work
channel = undefined
}
return makeEffect(effectTypes.PUT, { channel, action })
}
const cpsCb = (err, res) => {
if (is.undef(err)) {
cb(res)
} else {
cb(err, true)
}
}