Metadata-Version: 2.0
Name: aioredux
Version: 1.0.0
Summary: Pythonic redux
Home-page: https://github.com/ariddell/aioredux
Author: aioredux developers
Author-email: aioredux-developers@example.net
License: UNKNOWN
Platform: UNKNOWN
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Requires-Dist: pbr (>=1.4,<2.0)
Requires-Dist: toolz (>=0.7.4)

========
aioredux
========

|pypi| |travis| |downloads|

Pythonic `Redux <https://github.com/rackt/redux>`_

Pythonic `Redux <https://github.com/rackt/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 <https://github.com/rackt/redux>`_
documentation).

* Free software: Mozilla Public License

**This package requires Python 3.4 or higher**

Usage
-----
::

    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')


Implementation notes
--------------------
- ``dispatch`` is a 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.


.. |pypi| image:: https://badge.fury.io/py/aioredux.png
    :target: https://badge.fury.io/py/aioredux
    :alt: pypi version

.. |travis| image:: https://travis-ci.org/stan-dev/aioredux.png?branch=master
    :target: https://travis-ci.org/stan-dev/aioredux
    :alt: travis-ci build status

.. |downloads| image:: https://img.shields.io/pypi/dm/aioredux.svg
    :target: https://pypi.python.org/pypi/aioredux
    :alt: pypi download statistics



