Import only the needed things from lodash
This commit is contained in:
parent
fce394f6bd
commit
84fecb7a92
2 changed files with 4 additions and 4 deletions
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Server from '../../models/server';
|
import Server from '../../models/server';
|
||||||
import _ from 'lodash';
|
import debounce from 'lodash/debounce';
|
||||||
import differenceInSeconds from 'date-fns/difference_in_seconds';
|
import differenceInSeconds from 'date-fns/difference_in_seconds';
|
||||||
import Flash from '../Flash';
|
import Flash from '../Flash';
|
||||||
import ServerBox from './ServerBox';
|
import ServerBox from './ServerBox';
|
||||||
|
@ -112,7 +112,7 @@
|
||||||
* Handle a search for servers but only call the search function every 500ms
|
* Handle a search for servers but only call the search function every 500ms
|
||||||
* at the fastest.
|
* at the fastest.
|
||||||
*/
|
*/
|
||||||
onChange: _.debounce(function () {
|
onChange: debounce(function () {
|
||||||
this.loadServers(this.$data.search);
|
this.loadServers(this.$data.search);
|
||||||
}, 500),
|
}, 500),
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import _ from 'lodash';
|
import isObject from 'lodash/isObject';
|
||||||
import { mapState, mapActions } from 'vuex';
|
import { mapState, mapActions } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const response = error.response;
|
const response = error.response;
|
||||||
if (response.data && _.isObject(response.data.errors)) {
|
if (response.data && isObject(response.data.errors)) {
|
||||||
response.data.errors.forEach(e => {
|
response.data.errors.forEach(e => {
|
||||||
this.error(e.detail);
|
this.error(e.detail);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue