# handle(\_:\_:)

Answers JS’s `ref.hook("<key>", method, args)`: `handler` gets the arguments, which cross as JSON, and a [`HookReply`](<https://rasmuskard.github.io/react-native-minimal-webview/swift/documentation/minimalwebview/hookreply/index.md>), which it calls with the reply or fails, then or later.

```
func handle(_ method: String, _ handler: @escaping (_ args: [Any], _ reply: HookReply) -> Void)
```

## Discussion

One handler per method: the last one wins. A handler that never replies leaves the call waiting until the view unmounts: a navigation or a crash doesn’t settle it.
