How to use the buttercup/dist/buttercup-web.min.vendor function in buttercup

To help you get started, we’ve selected a few buttercup 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 buttercup / buttercup-desktop / src / renderer / index.js View on Github external
} from '../shared/actions/ui-state';
import { setupShortcuts } from './system/shortcuts';
import { setSetting } from '../shared/actions/settings';
import { changeMode } from '../shared/actions/entries';
import { addGroup } from '../shared/actions/groups';
import { getSetting, getUIState } from '../shared/selectors';
import Root from './containers/root';
import { getQueue } from './system/queue';

// Unhandled rejections
const unhandled = require('electron-unhandled');
unhandled();

// Alter some Buttercup internals
Buttercup.Web.HashingTools.patchCorePBKDF();
Buttercup.vendor.webdav.setFetchMethod(window.fetch);

// Create store
const store = configureStore({}, 'renderer');

i18n.changeLanguage(getSetting(store.getState(), 'locale'));
linkArchiveManagerToStore(store);
setupShortcuts(store);

// Reset current archive
store.dispatch(setSetting('archivesLoading', true));
store.dispatch(setCurrentArchive(null));
store.dispatch(resetArchivesInStore([]));

ipc.on('import-history', (e, payload) => {
  store.dispatch(importHistoryIntoArchive(payload));
});