How to open the `alpha.nvim` dashboard when the last buffer is closed?

I use goolord/alpha.nvim for a custom greeter & dashboard UI. And I would like it open up when I close the last open buffer.

The behaviour I’m looking for is provided here in this GH discussion - Open alpha when all buffers closed? · Discussion #85 · goolord/alpha-nvim · GitHub but it uses bufdelete.nvim plugin which is something I would like to avoid. I’m not a big fan of how the bufdelte.nvim plugin handles Neovim behaviour.

So, how do I go about configuring Neovim to do so using Lua code?

ExitPre autocommand might be somthing to look at. Although, I haven’t yet found a way to prevent exiting in lua. Here’s the vimscript version