New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify API #10

Closed
neocotic opened this Issue Sep 15, 2014 · 3 comments

Comments

1 participant
@neocotic
Copy link
Owner

neocotic commented Sep 15, 2014

Ideally, it would be great if the call to Backbone.Do(model) was no longer required and, instead, we hooked into the model initialization to ensure any actions are prepared before initialize is called. This would make the API of this plugin appear more seamless and integrated into Backbone.

Also, I've found that in lot a lot of cases I'm always having to specify the data option when performing an action, so I can only imagine that this is common for others too. For this reason, I think it would be best to improve the API for performing an action so that the first argument is always expected to be the data (while remaining optional) and then shifting the existing arguments.

@neocotic neocotic added this to the 1.0.0 milestone Sep 15, 2014

@neocotic

This comment has been minimized.

Copy link
Owner

neocotic commented Sep 15, 2014

I can't remember if the code does this already, but I want to ensure that an error is thrown if an action name is the same as an existing property on that model, potentially exposing a global option to override this behaviour (which would not be recommended).

@neocotic

This comment has been minimized.

Copy link
Owner

neocotic commented Sep 15, 2014

I can't find a good way of avoiding the need to call Backbone.Do(model) on initialization as I can't find a good clean way of hooking into the initialization itself.

@neocotic neocotic referenced this issue Sep 15, 2014

Merged

Cleaned API #12

2 of 2 tasks complete

@neocotic neocotic self-assigned this Sep 15, 2014

@neocotic

This comment has been minimized.

Copy link
Owner

neocotic commented Sep 15, 2014

PR #12 has made the necessary changes apart from the exception mentioned in my previous comment.

@neocotic neocotic closed this Sep 15, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment