Classes
FlowScreen
4
▼
A screen in a flow with its template and reducer.
FlowScreen
4
▼
A screen in a flow with its template and reducer.
Attributes
| Name | Type | Description |
|---|---|---|
name |
str
|
— |
template |
str
|
— |
reducer |
Callable
|
— |
Methods
Internal Methods 1 ▼
__rshift__
1
Flow
▼
screen_a >> screen_b creates a Flow.
__rshift__
1
Flow
▼
def __rshift__(self, other: FlowScreen) -> Flow
Parameters
| Name | Type | Description |
|---|---|---|
other |
— |
Returns
Flow
FlowState
2
▼
Runtime state for a flow.
FlowState
2
▼
Runtime state for a flow.
Attributes
| Name | Type | Description |
|---|---|---|
current_screen |
str
|
— |
screen_states |
dict[str, Any]
|
— |
Flow
7
▼
Declarative multi-screen state machine.
Flow
7
▼
Declarative multi-screen state machine.
Attributes
| Name | Type | Description |
|---|---|---|
screens |
tuple[FlowScreen, ...]
|
— |
transitions |
tuple[Transition, ...]
|
— |
Methods
template_map
0
dict[str, str]
▼
Map screen names to template names.
property
template_map
0
dict[str, str]
▼
def template_map(self) -> dict[str, str]
Returns
dict[str, str]
from_screens
1
Flow
▼
Create a flow from an ordered sequence of screens.
classmethod
from_screens
1
Flow
▼
def from_screens(cls, *screens: FlowScreen) -> Flow
Parameters
| Name | Type | Description |
|---|---|---|
*screens |
— |
Returns
Flow
with_transition
3
Flow
▼
Add a custom transition.
with_transition
3
Flow
▼
def with_transition(self, from_screen: str, to_screen: str, *, on: str) -> Flow
Parameters
| Name | Type | Description |
|---|---|---|
from_screen |
— |
|
to_screen |
— |
|
on |
— |
Returns
Flow
build_reducer
0
Callable
▼
Build a combined reducer that routes actions to the current screen's reducer.
build_reducer
0
Callable
▼
def build_reducer(self) -> Callable
Returns
Callable
Internal Methods 1 ▼
__rshift__
1
Flow
▼
flow >> screen_c extends the flow.
__rshift__
1
Flow
▼
def __rshift__(self, other: FlowScreen) -> Flow
Parameters
| Name | Type | Description |
|---|---|---|
other |
— |
Returns
Flow