jdonaldson / promhx

A promise and functional reactive programming library for Haxe
MIT License
145 stars 24 forks source link

Feature : Detect unhandled promises on compile time #85

Open mastef opened 7 years ago

mastef commented 7 years ago

Not sure how feasible of an approach this would be but it would be nice to have a list of returned, but un-handled, promises pop up as warnings at compile time - and/or if catchError is missing.

function abc() {
    var def = new Deferred<String>();
    ....
    return def.promise();
}

abc();

Would then come up with a compile warning that abc() is missing a .catchError() ( and .then() ).

jdonaldson commented 7 years ago

You probably can't do this at compile time, but it may be possible in runtime. This behavior would add overhead, but perhaps it could be done as a flag. I'll leave this open and think about it.