All you have to do is
- name your event handlers appropriately:
- eventualize your class:
: ->@confirm_button = $'#confirm'@cancel_button = $'#cancel'# Wire up all event listeners that exist in this class.# This is equivalent to# - @confirm_button.on 'click', @on_confirm_button_click# - @cancel_button.on 'click', @on_cancel_button_click# - @cancel_button.on 'hover', @on_cancel_button_hovereventualize this: ->consolelog 'The yes button was clicked': ->consolelog 'The no button was clicked': ->consolelog 'The no button was hovered'
Eventualize also works on the server, for example with Node.js:
: ->@socket =# Wire up all event listeners in this class.# This is equivalent to# - @socket.on 'open', @on_socket_open# - @socket.on 'data', @on_socket_data# - @socket.on 'error', @on_socket_error# - @socket.on 'close', @on_socket_closeeventualize this=consolelog 'The socket is open'=consolelog 'Received new data'=consolelog "Error: "=consolelog 'Socket closed'
- tell us about an idea for a new feature: https://github.com/kevgo/eventualize/issues
- praise or feedback: https://github.com/kevgo
- set up the development environment on your machine:
- run tests:
- compile a new release:
- contribute some changes: unit-tested pull requests please! :heart_eyes_cat: