mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
22 lines
455 B
JavaScript
22 lines
455 B
JavaScript
function Rmem(){
|
|
var opt = {}, store = {}, u;
|
|
opt.put = function(file, data, cb){
|
|
//setTimeout(function(){ // make async
|
|
store[file] = data;
|
|
cb(null, 1);
|
|
//}, 1);
|
|
};
|
|
opt.get = function(file, cb){
|
|
//setTimeout(function(){ // make async
|
|
var tmp = store[file] || u;
|
|
cb(null, tmp);
|
|
//}, 1);
|
|
};
|
|
return opt;
|
|
}
|
|
|
|
if(typeof window !== "undefined"){
|
|
window.Rmem = Rmem;
|
|
} else {
|
|
try{ module.exports = Rmem }catch(e){}
|
|
} |