How can I dynamically call a method from another in AlpineJS? In the example below, foo() should call bar() to run the method it receives. This doesn't work, because 'Uncaught TypeError: callback is not a function'.
foo(){
bar(this.baz())
},
bar(method){
method()
},
baz(){
return 'success'
}