Having said that, if you're doing it for yourself then yeah, just try it and see :)
You could have a callback for a read - the only issue is if you waited for the response. I think a lot of devices wouldn't be willing to wait for long enough so you'd really need to at least offer a solution that just pushed the data ASAP.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
For I2C, yes - that's pretty much the idea. The API used in the example looks different to the one I use (eg https://github.com/espruino/Espruino/blob/ab227f54ad5585d5ceaa7cfd6b54634ee0dc609d/targets/stm32/jshardware.c#L2338) but it's the same idea (also I'd have to make sure the code for I2C master still worked :).
Having said that, if you're doing it for yourself then yeah, just try it and see :)
You could have a callback for a read - the only issue is if you waited for the response. I think a lot of devices wouldn't be willing to wait for long enough so you'd really need to at least offer a solution that just pushed the data ASAP.