Comments (3)
I think it is possible. At least from Android. There is a LocalStorage public class in Cobalt that you can use.
On iOS it's not available but you can easily add the "setItem", "getItem", "removetItem", and "clear" events in cobalt init, and forward the parameters to cobalt.storage.getItem, cobalt.storage.setItem and so on.
here is a quick untested example :
cobalt.init({
events:{
"setItem":function(data, callback){
cobalt.storage.setItem(data.key, data.value, data.type)
},
"getItem":function(data, callback){
if (callback){
cobalt.sendCallback( callback, { value : cobalt.storage.getItem(data.key, data.type)} )
}
}
}
//and so on...
});
from cobalt.
anyway we keep this idea as an enhancement
thanks for the idea
from cobalt.
duplicate of #118
from cobalt.
Related Issues (20)
- cobalt.conf: optional ios/android classes and use Cobalt ones as default HOT 8
- Merge Cobalt 1.0 into WKWebView
- pluginify imagePicker
- update SideMenu to use cobalt1.0
- update Helloworld to use cobalt1.0 HOT 1
- fix Android PDF plugin
- fix Android Share plugin
- fix iOS Snackbar plugin
- fix Android location plugin
- pluginify Permissions / or add it to cobalt
- imageResize weirdly resizes
- Migrate FirebaseAnalytics Plugin to cobalt 1.0
- Migrate FCM Plugin to cobalt 1.0
- fix cobalt:onAppStarted
- reverse Android subscribeToChannel params
- change bar handler with onItemPressed(item_id, callback)
- Permissions and Image cleanup HOT 3
- Cobalt iOS module
- Cobalt crashes while tracing in Devtools Performance tab
- Can we create an HTML folder in all directory.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cobalt.