Skip to content

Instantly share code, notes, and snippets.

@jhonoryza
Forked from joshcirre/nprogressmagic.js
Created December 11, 2023 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhonoryza/87808062a64c95d8b10d4d7f39a68768 to your computer and use it in GitHub Desktop.
Save jhonoryza/87808062a64c95d8b10d4d7f39a68768 to your computer and use it in GitHub Desktop.
// In Laravel app.js
import NProgress from 'nprogress';
Livewire.hook('commit', ({ component, commit, respond, succeed, fail }) => {
NProgress.start()
succeed(({ spanshot, effect }) => {
queueMicrotask(() => {
NProgress.done(true)
NProgress.remove()
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment