chore(vue-app): deprecate callback-based asyncData, fetch and middleware (#4256)

This commit is contained in:
Alexander Lichter 2018-11-06 13:02:07 +00:00 committed by Pooya Parsa
parent 3953eef271
commit 10c608a649

View File

@ -226,6 +226,11 @@ export function middlewareSeries(promises, appContext) {
export function promisify(fn, context) {
let promise
if (fn.length === 2) {
<% if (isDev) { %>
console.warn('Callback-based asyncData, fetch or middleware calls are deprecated. ' +
'Please switch to promises or async/await syntax')
<% } %>
// fn(context, callback)
promise = new Promise((resolve) => {
fn(context, function (err, data) {