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

Rethink converters #22

Merged
merged 5 commits into from
Apr 22, 2015
Merged

Conversation

FagnerMartinsBrack
Copy link
Member

Inspired by carhartl/jquery-cookie#151 (comment)

Update April 4, 2016

This basically allows the user to intercept the cookie default decoding mechanism, since we can't do both JSON handling (which was done out of the box by #10) and decoding mechanism in the same callback.

More information about this can be seen at #132 (comment)

@FagnerMartinsBrack FagnerMartinsBrack mentioned this pull request Apr 20, 2015
13 tasks
@FagnerMartinsBrack FagnerMartinsBrack added this to the 2.0 milestone Apr 20, 2015
@carhartl
Copy link
Member

Great! Just wondering, what about the following alternative syntax:

Cookies(function () { /* the converter function */ })

Maybe it's nonsense?

@FagnerMartinsBrack
Copy link
Member Author

In this case how the reader of the code would know the function represents a converter?

Ok, it could be written as:

Cookies(function converter() {
  /* ... */ 
});

But then in the unescape case things get cryptic.

// What does unescape do here?
var cookies = Cookies(unescape);

@FagnerMartinsBrack
Copy link
Member Author

Merging this in order to start new pull requests on top of branch 2.0 without code conflicts. Discussion can continue.

FagnerMartinsBrack added a commit that referenced this pull request Apr 22, 2015
@FagnerMartinsBrack FagnerMartinsBrack merged commit ad741fd into server-encoding-test Apr 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants