There are a couple of issues with this:

1. We are passing the datatype as expected for the JS function, so boolean is actually `bool` and interger/numeric is actually `int`. I did this to avoid having to have the translation logic in the `get_pref` method.

2. We are passing exactly what we want passed to the JS method as the value, so if I want to pass true, I pass `'true'` as opposed to the Python `True`, so I'm not sure if type inference would even work in these situations.

I might be able to get it to work, but it would mean a lot more code in `get_pref`, so I prefer (pun inetnded) to keep things simple and just have the consumer pass the expected datatype.

What do you think?