Okay to create Toast(s) on the fly?

Is there any issue with doing the following for infrequent Toast messages?

  text: 'Top positioned toast',
  position: 'top',
  closeTimeout: 2000,

The above is done instead of creating a var. Should I do the above OR create a single global Toast and just change the text message every time before telling it to open?

I would rather not create a unique Toast object for every app message I need to give to the user.


1 Like

Yes, it is totally ok to do this. Better add also destroyOnClose: true parameter