notiflix / Notiflix

Notiflix is a pure JavaScript library for client-side non-blocking notifications, popup boxes, loading indicators, and more that makes your web projects much better.
https://notiflix.github.io
MIT License
635 stars 55 forks source link

[FEAT] - Change message of Loading dynamically #65

Closed JenuelDev closed 1 year ago

JenuelDev commented 1 year ago

Is your feature request related to a problem? Please describe.

Able to change the message of loading. Let's say for example there is 3 API request to run, and for each API request,

Describe the solution you'd like

I want them to change the Loading message from something like:

  1. Verifying your Identity
  2. Creating your Account
  3. Preparing your dashboard.

after it is prepared, it will then remove the loading state.

Describe alternatives you've considered

None

Additional context

None

furcan commented 1 year ago

https://github.com/notiflix/Notiflix#4--loading-module

JenuelDev commented 1 year ago

I think you did not get what I am trying to achieve... lets say for example,, I click a button submit..

when I clicked the submit..

a loader appear.. like Loader.standard("Verifying your Identiyyu"); while processing an API request for verifying the identity.

if the verification is successfull,,, then a new API will process, but still I like the loader to continue loading,, but I only want the Loading message to change.. so Loader.standart('creating your account'),, and so on and so fort..

if everything is processed that is the time on calling Loading.remove()

my problem is, the message is not changing.. how do I do that?

furcan commented 1 year ago

Hello @BroJenuel ,

I shared the link because there is a method as change() and I believe that it will be helpful for you.

Screenshot 2023-02-20 at 19 07 39

// started
Notiflix.Loading.standard('Loading...');

// your stuff

Notiflix.Loading.change('Still Loading...');

// your stuff

Notiflix.Loading.change('Yes, Still Loading...');

// your stuff

// done
Notiflix.Loading.remove();
JenuelDev commented 1 year ago

awesome thanks mate