Open ztnel opened 2 years ago
While this syntax is cleaner from a syntactic perspective, the implementation is significantly more complex. It will probably involve a module loader and extracting all functions with the subscribe
decorator to be loaded into the subscriber callback.
Because the state management systems primary api is implemented as a context manager it would make sense that state subscription callbacks can be wrapped by a decorator.
Current Implementation
In the consumer init you register a subscription to an async callback using the context manager:
Proposed Alternate Syntax
The alternative syntax is significantly cleaner: