Adding missing AjaxOptions #259

Merged
merged 2 commits into from Oct 10, 2012

2 participants

@michaelaird

I just went through the docs and noticed some AjaxOptions were missing.

@nikhilk
Owner

Can any of the dictionaries be more strongly typed? Example:

Dictionary<string, string> Accepts, Contents, Headers
Dictionary<int, Action> StatusCode
Dictionary<string, Func<string, object>> Converters
@michaelaird
@michaelaird

I've updated the changes but i'm a little concerned about the StatusCode. The docs say this:

If the request is successful, the status code functions take the same parameters as the success callback; if it results in an error, they take the same parameters as the error callback.

Is there a "clean" way to provide these 2 different signatures?

@nikhilk
Owner

One way would be to create a special type, rather than use a Dictionary with multiple indexers - one for Action, another for the success callback, and another for errors... though I feel its starting to take on a bit of overkill.

If they're uncommon, leave it as you have it right now, and within the method, one can use Arguments to get the value in a late-bound way.

jQuery never ceases to make me wonder - why so many ways to do the same thing?

@michaelaird

I think i'll leave it as-is and see if we get feedback. Clearly people haven't been missing these options...

@nikhilk nikhilk merged commit d159aa4 into nikhilk:master Oct 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment