Creating JS functions that can take arguments in _scripts (ReactiveHTML)

I’m trying to organize my JS in my ReactiveHTML component.
Is having a script return a function the only way to do this, or am I missing something?

Currently using this pattern:

"test": """
  return function test_fn(arg) {console.log(arg)}
""",
"after_layout": "self.test()('woohoo')"