Correctly await things.
This commit is contained in:
parent
394ab8c9d3
commit
492673d71d
|
@ -34,7 +34,7 @@ const migrations: Array<Migration<string>> = [
|
|||
];
|
||||
|
||||
// Migrate your data.
|
||||
const migrated = migrate(data, version, migrations);
|
||||
const migrated = await migrate(data, version, migrations);
|
||||
|
||||
// Congratulations, your data is now on version 1.0.2!
|
||||
console.log(migrated);
|
||||
|
|
|
@ -53,6 +53,9 @@
|
|||
},
|
||||
"xo": {
|
||||
"prettier": true,
|
||||
"rules": {
|
||||
"no-await-in-loop": "off"
|
||||
},
|
||||
"space": true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ export async function migrate<V>(
|
|||
continue;
|
||||
}
|
||||
|
||||
migratedData = migration.migrate(migratedData);
|
||||
migratedData = await migration.migrate(migratedData);
|
||||
}
|
||||
|
||||
return migratedData;
|
||||
|
|
Loading…
Reference in New Issue