Skip to content
New issue

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

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

Already on GitHub? # to your account

Make a helper method for getting a file's localStorage object #85

Closed
OscarGodson opened this issue May 1, 2012 · 3 comments
Closed
Assignees
Milestone

Comments

@OscarGodson
Copy link
Owner

Tired of writing:

JSON.parse(localStorage[self.settings.localStorageName]).file[self.settings.file.name];

Would rather write:

// Returns `JSON.parse(localStorage[self.settings.localStorageName])`
self.files();

//Returns `JSON.parse(localStorage[self.settings.localStorageName]).file[NAME]`
self.files(self.settings.file.name);

This should also be a public API method so devs can get files out without affecting the GUI.

@OscarGodson
Copy link
Owner Author

@johnmdonahue This is done and working, just have to write tests, but the naming part is the hardest. I went with fileList([name]). How do you feel about that? I wanted to do file or files but that felt like you should be able to do more with it like import and export. I was thinking about the Node and thought of fs, but too vague. Any other ideas?

@OscarGodson
Copy link
Owner Author

Think it should maybe be getFiles() to match getElements() and the fact we have a sort of actionNoun thing going too with importFile, exportFile, getElements, etc.

@johnmdonahue
Copy link
Collaborator

Late to the party but +1 on getFiles()

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants