Testing your changes
Now that you have implemented your first flag, it's time to test it.
Click the Run button above the code editor in Replit to restart the game. With the flag targeting turned off, you will still see the dinosaur sprite.
Turning on the flag
To turn on the flag:
-
Navigate to your Space Mode flag in the LaunchDarkly dashboard.
-
Toggle the flag on. Then click the Save changes button.
-
In Replit, click the Run button to restart the game and see the space sprites in use.
Congratulations! You've not only made a significant change to an app, but you controlled the release of that change using a feature flag.
However, when that release is made, the page still needs to be reloaded. Wouldn't it be great if the page could detect the flag change and update itself without needing to be reloaded?
On the next page, you'll add the code which gives the page that ability.