Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Config #2

Closed
wants to merge 3 commits into from
Closed

Add Config #2

wants to merge 3 commits into from

Conversation

surz90
Copy link
Collaborator

@surz90 surz90 commented Aug 6, 2024

No description provided.

@@ -0,0 +1,32 @@


export enum GameIds {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if intead of having this list here, that would require that every time we have a new game we need to make an update from the lib, we pass the game-id string to the library init ?

I'm already doing that and storing it in the Cache.config inside the sdk file.
And keep this config logic with the environments and server configs agnostic to the game ids
https://github.com/decentraland/sdk-mini-games/blob/main/src/index.ts#L9-L11

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// inside the library

const { config } = getSDK()
const GAME_ID = config.gameId
fetch(someEndpoint(GAME_ID))

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks gon! i close this PR and create a new one

@surz90 surz90 closed this Aug 6, 2024
@surz90 surz90 deleted the config branch August 6, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants