How to use the localforage.config function in localforage

To help you get started, we’ve selected a few localforage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github johannesjo / super-productivity / src / app / core / persistence / database.service.ts View on Github external
private _init() {
    localForage.config({
      driver: [localForage.INDEXEDDB, localForage.WEBSQL, localForage.LOCALSTORAGE],
      name: 'SUP',
      // version: 1.0,
      storeName: 'SUP_STORE', // Should be alphanumeric, with underscores.
      description: 'All data for Super Productivity 2'
    });
  }
}
github rakannimer / react-orchestra / web / src / platforms / web / stores / index.js View on Github external
init() {
    localforage.config({
      // driver: localforage.INDEXEDDB, // Force WebSQL; same as using setDriver()
      name: 'react_orchestra',
      version: 1.0,
      size: 4980736, // Size of database, in bytes. WebSQL-only for now.
      storeName: 'react_orchestra', // Should be alphanumeric, with underscores.
      description: 'React Orchestra storage to cache mp3 notes and store app state',
    });
    this.db = localforage.createInstance({
      name: 'react_orchestra',
    });
  },
  async set(key, value) {
github BigDataBoutique / ElastiQuill / admin-frontend / src / index.js View on Github external
import "medium-editor/dist/css/themes/default.css";

// Needed for enabling medium-editor-insert-plugin jquery plugin
import "./lib/medium-editor-insert-plugin.min.css";
window.$ = window.jQuery = require("jquery");
require("../node_modules/medium-editor/dist/js/medium-editor.js");
require("../node_modules/handlebars/dist/handlebars.runtime.min.js");
require("../node_modules/blueimp-file-upload/js/vendor/jquery.ui.widget.js");
require("../node_modules/blueimp-file-upload/js/jquery.iframe-transport.js");
require("../node_modules/blueimp-file-upload/js/jquery.fileupload.js");
require("./lib/jquery-sortable-min.js");
require("./lib/linkify.min.js");
require("./lib/linkify-jquery.min.js");
window.MediumInsert = require("./lib/medium-editor-insert-plugin.min.js").MediumInsert;

localforage.config({
  name: "ElasticBlogEngine",
  storeName: "app_store",
});

render(, document.getElementById("root"));
github morkro / happy-plants / src / main.js View on Github external
import errorHandler from '@/utils/vue-error-handler'
import pkg from '#/package.json'

import './registerComponents'
import './registerServiceWorker'

const isProduction = process.env.NODE_ENV === 'production'

/**
 * This is required as Webpack seems to do some static analysis
 * and breaking the module.
 * @see https://github.com/localForage/localForage-startsWith/issues/5
 */
extendPrototype(localforage)

localforage.config({
  name: 'happy-plants',
  driver: [localforage.INDEXEDDB, localforage.LOCALSTORAGE]
})

// Temporary fix to clean up DB.
localforage.keys()
  .then(keys => {
    if (keys.includes('undefined')) {
      localforage.removeItem('undefined')
    }
  })

/**
 * Vue configuration.
 */
Vue.config.productionTip = isProduction
github joelshepherd / tabliss / src / data / store.ts View on Github external
// Create store
export const store = createStore(
  combineReducers({
    booted,
    dashboard,
    settings,
    storage,
    version,
    ui,
  }),
  autoRehydrate(),
);

// Setup localForage
localForage.config({
  name: 'tabliss',
  storeName: 'state',
});

// Begin periodically persisting the store
export const persistor = persistStore(store, {
  debounce: 100,
  keyPrefix: '',
  serialize: false,
  storage: localForage,
  transforms: [
    createBlacklistFilter('booted'),
    createBlacklistFilter('ui', ['pending', 'settings']),
  ],
});
github Cloud-Player / web / src / app / modules / main / main.module.ts View on Github external
constructor() {
    /* TODO remove when it is working again
     * With the latest version of localforage Firefox can not use indexDB
     * "A mutation operation was attempted on a database that did not allow mutations."
     * Therefor we have to use localstorage until it is fixed
     */
    if (ClientDetector.getClient().name === ClientNames.Firefox) {
      localforage.config({
        driver: localforage.LOCALSTORAGE
      });
    }
  }
github AuHau / daGui / app / core / renderer / index.js View on Github external
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import configureStore from 'shared/store/configureStore';
import './app.global.scss';
import Config from '../../config/index';
import localForage from 'localforage';

import cssVariables from '!!sass-variable-loader!renderer/variables.scss';
import darkBaseTheme from 'material-ui/styles/baseThemes/darkBaseTheme';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';

import App from './containers/App';

// localForage configuration
localForage.config(Config.localForageConfig);

darkBaseTheme.fontFamily = cssVariables.fontFamily;
darkBaseTheme.palette.textColor = cssVariables.fontColor;
darkBaseTheme.palette.accent1Color = cssVariables.materialUiAccentColor;
darkBaseTheme.palette.accent2Color = cssVariables.materialUiAccentColor;
darkBaseTheme.palette.accent3Color = cssVariables.materialUiAccentColor;

const store = configureStore();

render(
  
    
      
    
  ,
  document.getElementById('root')
github dailymotion / camcorder / src / scripts / store.js View on Github external
constructor(name) {
    // TODO : check for localforage.supports(localforage.INDEXEDDB)
    localforage.config({
      driver: localforage.INDEXEDDB,
      name,
    })
  }
github iY0Yi / ShaderBoy / src / js / io / io.js View on Github external
init()
	{
		localforage.config({
			driver: localforage.INDEXEDDB,
			name: 'ShaderBoy',
			version: 1.0,
			storeName: 'shaderdata'
		})

		ShaderBoy.renderScale = 2
		ShaderBoy.editor.textSize = 16

		this.initLoading = true
		this.isNewShader = false
		this.isAppInit = false
		this.idList = {}

		this.ID_DIR_APP = ''
		this.ID_DIR_SHADER = ''