Skip to content

Instantly share code, notes, and snippets.

@Yardanico
Created May 29, 2020 19:42
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 Yardanico/343154579666a62a82336385fd491737 to your computer and use it in GitHub Desktop.
Save Yardanico/343154579666a62a82336385fd491737 to your computer and use it in GitHub Desktop.
# An example of the usage, async is here just for fun
import asyncdispatch
var spinner1 = newSpinny("Loading file..".fgWhite, Dots, time = true)
spinner1.setSymbolColor(colorize.fgBlue)
spinner1.start()
proc test {.async.} =
await sleepAsync(3000)
waitFor test()
spinner1.success("File was loaded successfully.")
var spinner2 = newSpinny("Downloading files..".fgBlue, Dots5)
spinner2.setSymbolColor(fgLightBlue)
spinner2.start()
# do some work here
for x in countup(5, 10):
sleep(500)
spinner2.error("Sorry, something went wrong during downloading!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment