sindresorhus / electron-store

Simple data persistence for your Electron app or module - Save and load user preferences, app state, cache, etc
MIT License
4.57k stars 148 forks source link

Return value of `shell.openPath` in `openInEditor` #272

Closed kiavashp closed 6 months ago

kiavashp commented 6 months ago

Summary

This PR returns the value of shell.openPath() in the openInEditor method

Motivation

If someone needs to perform an action only after the path has been opened, there's currently no way to do that, since the async shell.openPath() call isn't waited on, or return value passed through.

Use Case

My specific use case was wanting to quit the app after using this method to open a invalid (not matching the schema) config file. And without the return value I had to use shell.openPath() directly so I could await it.

kiavashp commented 6 months ago

Please let me know if you think the README should be updated to specify the return value of this method explicitly, or any tests should be added, etc.

I didn't have a model for what those would look like in the rest of the project.

Thanks!

sindresorhus commented 6 months ago

The readme needs to be updated, yes.

kiavashp commented 6 months ago

@sindresorhus docs updated!