Skip to content

Commit

Permalink
fix typo in examplo
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Duthie <[email protected]>
  • Loading branch information
eileen-nava and aduth authored Nov 6, 2024
1 parent 8434282 commit 68ba1a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _articles/manage-50-50-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ of the cases above.
## JavaScript Requests from API Endpoints
We can hit 50/50 state errors when JavaScript requests to an API endpoint assume that the data will take a certain shape. A newer or older instance may respond to the request in a way that the JavaScript isn't prepared to handle. This could cause unpredictable behavior, or may cause the code to throw an error if it assumes that a response property will exist.
To avoid such an error, consider modifying the JavaScript to be less coupled with the shape of the data that the API returns. For example, you can define the response shape to define its properties as potentially `undefined`, which will also allow TypeScript type-checking to identify and potential errors that could be thrown.
To avoid such an error, consider modifying the JavaScript to be less coupled with the shape of the data that the API returns. For example, you can define the response shape to define its properties as potentially `undefined`, which will also allow TypeScript type-checking to identify any potential errors that could be thrown.
When introducing a new endpoint that you intend to request from, you can avoid 50/50 deployment issues by including the API endpoint in a separate, earlier deployment. Then you can safely assume that the endpoint will be available from your JavaScript code.
Expand Down

0 comments on commit 68ba1a1

Please sign in to comment.