Skip to content

Commit

Permalink
🚨 Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Jan 28, 2018
1 parent 0d74d5c commit adeab4c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
7 changes: 4 additions & 3 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Vue from 'vue';
import App from './App';
import Vue from 'vue'
import App from './App'

// eslint-disable-next-line
new Vue({
el: '#app',
render: h => h(App),
});
})
46 changes: 23 additions & 23 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,56 @@ export default {
error: null,
}),

render(h) {
render (h) {
if (this.error instanceof Error || (this.error && this.error.length)) {
return this.$scopedSlots.error(this.error);
return this.$scopedSlots.error(this.error)
} else if (this.resolved) {
return this.$scopedSlots.default(this.data);
return this.$scopedSlots.default(this.data)
} else {
return this.$slots.default[0];
return this.$slots.default[0]
}
},

watch: {
promise: {
handler(promise) {
if (!promise) return;
this.resolved = false;
this.error = null;
handler (promise) {
if (!promise) return
this.resolved = false
this.error = null
promise
.then(data => {
if (this.promise === promise) {
this.resolved = true;
this.data = data;
this.resolved = true
this.data = data
}
})
.catch(err => {
if (this.promise === promise) this.error = err;
});
if (this.promise === promise) this.error = err
})
},
immediate: true,
},

promises: {
handler(promises) {
if (!promises) return;
this.resolved = false;
this.error = [];
this.data = [];
handler (promises) {
if (!promises) return
this.resolved = false
this.error = []
this.data = []
promises.forEach(p => {
p
.then(data => {
if (this.promises === promises) {
this.resolved = true;
this.data.push(data);
this.resolved = true
this.data.push(data)
}
})
.catch(err => {
if (this.promises === promises) this.error.push(err);
});
});
if (this.promises === promises) this.error.push(err)
})
})
},
immediate: true,
},
},
};
}
3 changes: 1 addition & 2 deletions test/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { mount } from '@vue/test-utils'
import Promised from '../src'
import Helper from './utils/Helper'

const tick = () => new Promise(r => setImmediate(r))
const tick = () => new Promise(resolve => setImmediate(resolve))

describe('Tweezing', () => {
let wrapper
Expand Down

0 comments on commit adeab4c

Please sign in to comment.