diff --git a/Termdash-API.md b/Termdash-API.md index 06fcaf9..1a50083 100644 --- a/Termdash-API.md +++ b/Termdash-API.md @@ -62,6 +62,19 @@ if err := termdash.Run(ctx, t, c); err != nil { } ``` +## [termdash.RedrawInterval](https://github.com/mum4k/termdash/blob/275d95ad418b6ecca8817de4b013b440fc9abbe6/termdash.go#L55-L62) + +The **termdash.RedrawInterval** is used to specify how often will the screen redraw when starting Termdash via the **termdash.Run** function. This option is ignored when using the **termdash.NewController**. + +The following code snippet shows how to run a Termdash application that will redraw every three seconds: + +```go +// Create context ctx, terminal t and container c as in the examples above. +if err := termdash.Run(ctx, t, c, termdash.RedrawInterval(3 * time.Second)); err != nil { + return fmt.Errorf("termdash.Run => %v", err) +} +``` + ## [termdash.NewController](https://github.com/mum4k/termdash/blob/ffbf88caeddb1735dcf2a5f735eec80dc9cf9fe7/termdash.go#L113-L130): The **NewController** function creates a new **Controller** instance which allows the user to manually trigger a screen redraw. Periodic redraws are disabled in this mode. Termdash will still redraw the screen each time an input event happens, e.g. a keyboard, a mouse event or a terminal resize. @@ -121,4 +134,5 @@ if err != nil { return fmt.Errorf("termdash.NewController => %v", err) } defer ctrl.Close() -``` \ No newline at end of file +``` +## [termdash.ErrorHandler](https://github.com/mum4k/termdash/blob/1c6947618b08ae236959763efd07278be5f03211/termdash.go#L64-L71): \ No newline at end of file