tiny promises/A+ implementation