Closed tj closed 13 years ago
I'm on the fence about this, the node style event methods are certainly shorter but are possibly less familiar to a client side javascript developer. I'd like to only have one set of methods for binding and triggering events in the end to keep the api focused.
You're right about the events module currently being shared between apps. I don't think this is a huge issue since I'm not really sure why you would need multiple apps on the same page.
This then suggests that perhaps the App object should be a singleton, enforcing the one app per page and sidestepping any unexpected issues that could arise by creating more than one app per page.
for testing etc I think it's always a good idea to spawn from a prototype, so I think we're good there, but yeah probably not a huge issue
let me know if you're not interested in all this stuff. I probably have slightly different goals, I just want a really tiny router really, but if I fork I'll (of course) give you attribution
I'm interested - just been real busy this last week! I'm aiming to get a 0.7 release out this week which will include these changes.
I've pushed some of these changes in the next branch.
I decided not to add the on
and emit
event methods. Although they are shorter than trigger
and bind
I don't think it is worth either changing the api or having two sets of methods to do the same thing.
I also moved the functionality of the davis
method into the main Davis
function, so that it creates and returns an automatically started instance of an app. This prevents us from polluting the global namespace with another function.
There are a few more tweaks that I'm going to make before merging this into master but thought you'd be interested in the latest changes.
sounds good!
Hey I've just pushed a new release incorporating these changes, as well as a few others. Let me know if there are any issues.
Thanks again for the changes to the build tools, much faster and more portable using make instead of rake.
awesome! good stuff man
.on / .emit and some refactoring