mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Edited comments & titles
This commit is contained in:
parent
720d192258
commit
ce989cbee0
2 changed files with 8 additions and 8 deletions
|
|
@ -1,12 +1,12 @@
|
|||
######
|
||||
####################
|
||||
Dependency injection
|
||||
######
|
||||
####################
|
||||
|
||||
Dependency injection is a programming technique that makes a class independent of its dependencies. It achieves that by decoupling the usage of an object from its creation. This helps you to follow `SOLID's <https://en.wikipedia.org/wiki/SOLID>`_ dependency inversion and single responsibility principles.
|
||||
|
||||
|
||||
How it works in aiogram
|
||||
======
|
||||
=======================
|
||||
For each update :class:`Dispatcher` passes handling context data. Filters and middleware can also make changes to the context.
|
||||
|
||||
To access contextual data you should specify corresponding keyword parameter in handler or filter. For example, to get :class:`FSMContext` we do it like that:
|
||||
|
|
@ -20,7 +20,7 @@ To access contextual data you should specify corresponding keyword parameter in
|
|||
|
||||
|
||||
Injecting own dependencies
|
||||
======
|
||||
==========================
|
||||
|
||||
Aiogram provides several ways to complement / modify contextual data.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue