AMythicDev / minus

An asynchronous, runtime data feedable terminal paging library for Rust
https://crates.io/crates/minus/
Apache License 2.0
317 stars 23 forks source link

Feature Request: Hooks #95

Open AMythicDev opened 1 year ago

AMythicDev commented 1 year ago

Some actions inside minus need to performed on certain events regardless of the situation in which that event occured. For example, doing cleanup needs to be done anytime the user exits, regardless of whether the pager is in static or dynamic mode. Hence we need to proper system to tap into some special events and call functions on that event. Hooks are a feature that allows multiple callback functions to be registered with a event and whenever that event occur, all of those functions would be called.

This feature will also allow end-applications to add their own events. For example in a application that fetches data from the internet, whenever the user reaches the end of output, a callback function would be called to fetch more data.