ceifa / steamworks.js

A steamworks implementation for nw.js/electron games
MIT License
398 stars 65 forks source link

MISC: Remove unused variable in init function #159

Closed catloversg closed 4 days ago

catloversg commented 1 month ago

restartAppIfNecessary is unused in the init function.

ceifa commented 4 days ago

actually the reason it is on the destructuring, is to remove it from the API returned

catloversg commented 3 days ago

to remove it from the API returned

@ceifa Can you clarify this part? I don't get it. What will happen if we remove restartAppIfNecessary from the destructuring?

ceifa commented 3 days ago

Note that the code picks the init, runCallbacks and restartAppIfNecessary from nativeBinding, and the rest, it puts on a variable called api, which is returned.

With this PR, the restartAppIfNecessary would also be included on the api, which is not intended to, as it should be outside of the client.

Your PR: typeof steamworks.init(480).restartAppIfNecessary // function

Current code: typeof steamworks.init(480).restartAppIfNecessary // undefined

The reason is because it is already outside the client: typeof steamworks.restartAppIfNecessary // function

catloversg commented 3 days ago

I get it now. Thanks for the explanation.