local-storage.js -- Add ability to 'get all keys' in local storage - #2598
local-storage.js -- Add ability to 'get all keys' in local storage#2598SharkPool-SP wants to merge 4 commits into
Conversation
Add 'getAll' method to retrieve all keys from storage.
|
!format |
Added a note on retrieving all keys from local storage.
|
i think i've shared my thoughts on adding new blocks that returns lists as JSON ... |
And several blocks in extensions in your gallery do this, there isn't a proper alternative. I don't know what you expect it should do. |
|
Then what's the better alternative? The scratch method has its flaws with commas or spaces. And for this block to actually be useable they'd have to split the output to an array or to different parts using text extension (which is an extra dependency regardless) |
|
I don't know. With a bit of extra work you can split by spaces pretty easily in native Scratch, but it doesn't really work when the values contain the delimiter, which is why I think JSON is better. Unfortunatley, it's another extension users would have to load and potentially is more confusing for some users |
And like I said, if you split by spaces, users would have to add the text extension to use the block to split text by a delimiter. That is unless the user wants to make their own parser, which is bulky and in the long run a waste of their time if they could use the alternative. |
|
Let's not forget some extensions in the gallery already do this... plus it's always reality that if the user doesn't understand the block, they won't use it which is fine. |
|
Okay |
|
i'm not proposing a space separator |
|
the scratch approach to lists is not big json the scratch approach to lists is blocks like "length of list" and "item 1 of list" no reason you can't have "number of things in storage" and "key of item 1 in storage" equivalent or even a "store keys in [list]" block |
well thats what we all assumed
|
|
Exactly |
|
Ok |
|
!format |
|
The formatting bot didn't find any formatting issues. It currently only checks the extensions folder. The author or a maintainer can run terminal command 'npm run format' manually to format all files. |
|
@GarboMuffin @Brackets-Coder fixed |





Resolves:
#1358