dependabot[bot] on npm_and_yarn
Bump express from 3.3.6 to 4.17… (compare)
dependabot[bot] on npm_and_yarn
Bump qs and http-server Bumps … (compare)
dependabot[bot] on npm_and_yarn
Bump qs, ampersand-model and ex… (compare)
dependabot[bot] on npm_and_yarn
Bump minimatch and precommit-ho… (compare)
dependabot[bot] on npm_and_yarn
dependabot[bot] on npm_and_yarn
Bump async from 0.2.9 to 2.6.4 … (compare)
dependabot[bot] on npm_and_yarn
My friend told me that when constructor
is used in a function, Webpack spits out an error on the console saying Uncaught TypeError: _WEBPACK_IMPORTED_MODULE_0_ thatmodule__.a is not a constructor
. He showed me the error. He said, in order to fix it, the word constructor
should be replaced with initialize
. The module being used and exported is ampersand-state
and it's in src/profile/index.js.
import State from 'ampersand-state';
export default State.extend({......
// blah blah, code removed for clarity
Then on the outer index.js(not src/profile/index.js), the code is
import Profile from 'src/profile';
export default module.exports = Profile;
What are your thoughts on the constructor issue?
render: function () {
if (!app.itemclasses.length) {
app.itemclasses.fetch();
};
this.renderWithTemplate();
this.renderCollection(this.collection, collectionView, this.queryByHook('recipe-list'));
if (!this.collection.length) {
this.fetchCollection();
};
},
ItemClassName: {
deps: ['Type'], fn: function () {
var itemclass = app.itemclasses.get(this.Type);
return itemclass != null ? itemclass.Name : '';
},
cache: false
}
app.itemclasses.fetch()
but probably need to see where they both get fetched etc. I assume the model with the derived ItemClassName is looking at the value of app.itemclasses before the fetch is done. You can either trigger changes on the models when app.itemclasses finishes fetch, or figure out a way to have you subview use a derived or some condition to waitFor both to be fetched.