ractive
Version:
Next-generation DOM manipulation
18 lines (13 loc) • 334 B
JavaScript
import log from 'utils/log';
export default function Ractive$toggle ( keypath, callback ) {
var value;
if ( typeof keypath !== 'string' ) {
log.errorOnly({
debug: this.debug,
messsage: 'badArguments',
arg: { arguments: keypath }
});
}
value = this.get( keypath );
return this.set( keypath, !value, callback );
}