Your answer looks fine to me, but if you don't want anything to happen after executing, you don't have to have the JsCmd
do anything. For example:
SHtml.ajaxText(myVar, (str) => {
myVar = str
myMethod()
JsCmds.Noop
})
Where the JsCmds.Noop
, is pretty much the same as issuing return
in plain JavaScript, so the function returns without doing anything. I put the codeblock inline for brevity, but you could also just do what you did with (str) => f(str)
and have your method return JsCmds.Noop
.