Skip to content

Instantly share code, notes, and snippets.

@frostming
frostming / promise.py
Last active June 16, 2024 18:17
Python implementation of JavaScript's Promise interface
"""
Python implementation of JavaScript's Promise interface
with the power of asyncio.
See https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise
for the API specification.
Authored by: Frost Ming <mianghong@gmail.com>
License: WTFPL
"""
@Duroktar
Duroktar / store.py
Created September 23, 2017 16:40
A basic Redux store for Python in 50 lines of code (including comments)
def createStore(reducer, state, enhancer):
"""
Store instance constructor
Usage:
.. code-block: python
from store import createStore