JS Promise in GM


Link to JS Promise in GM

Promise GML

[Old Version]

This is a 1:1 port of Javascript's promise object class. Apart from the requirement to use camel case for words like; then, all, catch, etc, The syntax works exactly the same as it would in Javascript.

Tests are included to fiddle around with.

Wanted to make something over the holiday break, and figured this would be a nice addition to many libraries. So on it's own it doesn't actually do much apart from a very basic coroutine system. But it's intended for use with libraries which handle either expensive computations, or async events. So this one is more for library creators then general use.

Would also recommend: Promise.gml - YellowAfterLife SimThreads - Tabularelf Coroutines - Juju Adams