aioredux
Pythonic Redux
Pythonic Redux using asyncio. aioredux provides a predictable state container with the following goal: “[Redux] helps you write applications that behave consistently, run in different environments …, and are easy to test” (from the Redux documentation).
Free software: Mozilla Public License
This package requires Python 3.4 or higher
Usage
import asyncio
import aioredux
async def go():
initial_state = {
'todos': (),
}
def add_todo(text):
return {'type': 'ADD_TODO', 'text': text}
def reducer(state, action):
if action['type'] == 'ADD_TODO':
todos = state['todos'] + (action['text'],)
return {'todos': todos}
return state
store = yield from aioredux.create_store(reducer, initial_state)
yield from store.dispatch(add_todo('todo text'))
print(store.state['todos'])
asyncio.get_event_loop().run_until_complete(go())
Implementation notes
dispatch is marked as async although in most cases it functions like a plain Python function returning a Future. This is done to allow for cases where dispatch performs a more complicated set of (async) actions.
A Pythonic version of redux-thunk is also included.
Metadata
Release files for aioredux 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| aioredux-1.1.0.tar.gz | 14.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aioredux-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.6 kB
Release files / aioredux-1.1.0.tar.gz
| Download URL | aioredux-1.1.0.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2b5f1fce67fe6e65f65a9ae6e1ced0c5d1891e5967666792bf75aa584a336dd
|
|
BLAKE2b-256 checksum How to use checksums |
6c9f61f46a38830b63f81f21e30e18bbf475451b4efacf8e8def602839ae57b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / aioredux-1.1.0-py3-none-any.whl
| Download URL | aioredux-1.1.0-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b8c4513a84c0acb97fa888815f335f0b051b9a454ed3f25f843dc9e99dc60360
|
|
BLAKE2b-256 checksum How to use checksums |
5c4dbd47eecef09ea5f3b9f239e08b4b06d835cd9cdcfa34f1c5dca1b0a1065f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for aioredux 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.