Closed driesdl closed 6 years ago
Driezzz, would you able to create a PR for this?
@frederikbosch I'll try.
Here is a hack:
yarn add localforage
// ember-cli-build.js
app.import('node_modules/localforage/dist/localforage.js');
app.import('vendor/shims/localforage.js');
// vendor/shims/localforage.js
(function() {
function vendorModule() {
'use strict';
return {
'default': self['localforage'],
__esModule: true,
};
}
define('localforage', [], vendorModule);
})();
mkdir -p bower_components
cd bower_components
ln -s ../node_modules/localforage localforage
I copied the adapter and serializer into my app, and am just using those.
I had to change window.localforage
to just localforage
and then import localforage from 'localforage'
I also added messages to all the promise rejections, because undefined errors are obnoxious :-)
See master branch.
When performing
ember install ember-localforage-adapter
it also installs a bower_component called 'localforage', woudl it be possible to remove this as a dependency? Or there any alternatives?