metarhia / globalstorage

Distributed Data Warehouse 🌍
https://metarhia.com
MIT License
60 stars 5 forks source link

Localstorage storage provider #106

Open tshemsedinov opened 6 years ago

tshemsedinov commented 6 years ago

LocalStorageProvider is a class for client-side web applications implements StorageProvider interface and connects GlobalStorage to localstorage (Web Storage API Interface), see specs: https://developer.mozilla.org/ru/docs/Web/API/Window/localStorage

DzyubSpirit commented 6 years ago

@tshemsedinov, I've stacked with warning building library for browser:

WARNING in ./node_modules/metarhia-common/common.js
20:35-42 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./node_modules/metarhia-common/common.js
 @ ./gs.js

I think it can be resolved with refactoring:

const submodules = [
    'utilities', // Common utilities
    'math', // Math common function 
].map(path => './lib/' + path).map(require);

to

require('./lib/utilities');
require('./lib/math');