After get data in Storage, how can execute next function?

I have already saved my data in Storage.

import { Storage } from '@ionic/storage';
    ... ... ...'usertype', usertype);

I have to create a function to get data from storage.
And the program must execute next functions after get data from storage.
How can I create get function or build programming logic?

setter and getter on storage return promises so you can do following'name').then((name) => {
  console.log('Me: Hey, ' + name + '! You have a very nice name.');
  console.log('You: Thanks! I got it for my birthday.');

Thank you @ankushagg93
I want to get data from storage as synchronous method.
You are right, the setter and getter on storage return promise, but I need function immediately to get data from storage.
Is it possible?


Restructure your code to only do what needs to be done once the promise resolves. Often, this involves assigning dummy default values to some object properties.

Thank you @rapropos
Do you have any link for restructured?
I need more detail.

@ankushagg93 already gave you a very clear example.