I am trying to use buffer.onWillSave(), from the atom documentation (https://atom.io/docs/api/v1.24.0/TextBuffer#instance-onWillSave) to try and force atom to carry out a function first, and then save.
The description says that the function will wait for any promises to be resolved before the Editor saves. However, in my case, the Editor saves regardless of the pending status of the promise.
Is there a particular/correct way I should be implementing my promise for it to work with onWillSave()? It could very well be that the error is on my part. Can anyone give me an example of using Promises with onWillSave()?
Any help would be appreciated.