Closed jelveh closed 4 days ago
Great idea! It seems closely related to a recent idea I proposed in the discussion here: Issue #790. I believe you would need the data to be global for this idea to work. Would you mind taking a look and letting me know your thoughts?
Welp, seems like this is not possible since we can't override localStorage. WAs a cool idea though :')
I propose implementing a feature that transforms the browser's
localStorage
API into a cloud-backed storage solution using Puter.js's Key-Value (KV) store. This enhancement would allow existing web applications to use cloud storage without modifying their codebase.Feature Details:
Overload
localStorage
Methods:localStorage
methods and properties.Use
localStorage
as a Caching Layer:localStorage
to serve as a local cache, potentially improving performance for frequently accessed data.Simple Integration:
localStorage
should continue to work without modifications.Methods to Implement:
setItem(key, value)
getItem(key)
removeItem(key)
clear()
key(index)
length
propertyImplementation Considerations:
localStorage
API.The following is a naive implementation which I think could be used as inspiration: