e09_refresh_cache_v2#

Feature:

No matter what user entered, always return a random value between 1 and 100. And this value is based on cache that won’t change while user is typing. However, we want to provide a way to refresh the value. User can type “!~”, then the value will be immediately refreshed, and the “!~” will be removed automatically.

Difficulty: Medium

Dependencies: NA

Demo: https://asciinema.org/a/631325

zelfred.gallery.e09_refresh_cache_v2.handler(query: str, ui: UI)[source]#

The handler is the core of a Zelfred App. It’s a user-defined function that takes the entered query and the UI object as inputs and returns a list of items to render.