# Basic configuration
config <- history()
# Custom configuration
config <- history(
key = "my-history",
stackSize = 50,
beforeAddCommand = JS("function(cmd, revert) {
console.log('Before adding command:', cmd);
// Only allow certain operations to be recorded
return cmd.method !== 'update';
}"),
afterAddCommand = JS("function(cmd, revert) {
console.log('Command added to ' + (revert ? 'undo' : 'redo') + ' stack');
}"),
executeCommand = JS("function(cmd) {
console.log('Executing command:', cmd);
}")
)
Run the code above in your browser using DataLab