> For the complete documentation index, see [llms.txt](https://hanfak.gitbook.io/workspace/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hanfak.gitbook.io/workspace/general-paradigms/patterns/api/loan-pattern.md).

# Loan Pattern

* Dont rely on the user to remember to close resources or handle leaky abstractions
  * you do it for them
* The leak is encapsulated in the api, prevents leaks on user side
