Skip to content
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

sync options #13

Closed
pgherveou opened this issue Jan 27, 2012 · 5 comments
Closed

sync options #13

pgherveou opened this issue Jan 27, 2012 · 5 comments

Comments

@pgherveou
Copy link
Contributor

iobind.sync does use options.url

what do you think about adding this piece of code taken from Backbone.Sync to enable this feature

    var getUrl = function (object) {

      if (options && options.url) {
        return _.isFunction(options.url) ? options.url() : options.url;
      }

      // ...
    };


// this way to trigger specialUrl:read, we can write 
collection.fetch(url: 'specialUrl') 

@logicalparadox
Copy link
Contributor

Sounds like a good idea to me. Can it be fit in with the current getUrl logic here?

Can you fork and do a pull request :) Same goes for #10

@pgherveou
Copy link
Contributor Author

Yep thats what I meant
Sorry I am too lazy to make pull request I can do that next time if you prefer

    var getUrl = function (object) {

      if (options && options.url) {
        return _.isFunction(options.url) ? options.url() : options.url;
      }

      if (!(object && object.url)) return null;
      return _.isFunction(object.url) ? object.url() : object.url;
    };

@pgherveou
Copy link
Contributor Author

didn't read the end of the msg ill do a pull request

@pgherveou
Copy link
Contributor Author

here it is #14
as for #10 not sure I have the right answer yet so that might not be worth a pull request, what do you think ?

@logicalparadox
Copy link
Contributor

Awesome. !thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants