Skip to content

More flexible handling of expires option in amplify.store - #105

Open
SteveTheTechie wants to merge 1 commit into
mikehostetler:masterfrom
SteveTheTechie:patch-1
Open

More flexible handling of expires option in amplify.store#105
SteveTheTechie wants to merge 1 commit into
mikehostetler:masterfrom
SteveTheTechie:patch-1

Conversation

@SteveTheTechie

Copy link
Copy Markdown

It would be nice to be able to just use {expires: "never"} or a specific date, and let amplify store figure out the details. My proposed changes allow for this via a small function that checks if expires is a string and then does the appropriate conversion to a millisecond offset. I used a function for this to keep the existing code "clean" and allow for other possible keywords for "expires" to be added to the function.

It would be nice to be able to just use {expires: "never"} or a specific date, and let amplify store figure out the details.   My proposed changes allow for this via a small function that checks if expires is a string and then does the appropriate conversion to a millisecond offset.  I used a function for this to keep the existing code "clean" and allow for other possible keywords for "expires" to be added to the function.
Comment thread src/store.js

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a small function to encapsulate handling of strings specified for the expires option.

@SteveTheTechie SteveTheTechie changed the title More flexible handling of expires option More flexible handling of expires option in amplify.store Dec 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants