mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
chore(vue-app): deprecate callback-based asyncData, fetch and middleware (#4256)
This commit is contained in:
parent
3953eef271
commit
10c608a649
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user