Skip to content

Commit b874fb5

Browse files
riwuexpbot
authored andcommitted
Fix wrong destructuring property in Expo.Audio.Sound.create example
`Expo.Audio.Sound.create` returns a [`Promise` that resolves to an object with `sound` as a property](https://docs.expo.io/versions/v28.0.0/sdk/audio#sound--the-newly-created-and-loaded), but the example tries to destructure with the key `soundObject` which will always be `undefined`. Fix: use `sound` for the destructuring assignment and rename it to `soundObject` so that it's consistent with the other examples. Closes expo/expo-docs#315 fbshipit-source-id: b411244
1 parent bd702da commit b874fb5

File tree

11 files changed

+11
-11
lines changed

11 files changed

+11
-11
lines changed

versions/unversioned/sdk/audio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A static convenience method to construct and load a sound is also provided:
117117

118118
```javascript
119119
try {
120-
const { soundObject, status } = await Expo.Audio.Sound.create(
120+
const { sound: soundObject, status } = await Expo.Audio.Sound.create(
121121
require('./assets/sounds/hello.mp3'),
122122
{ shouldPlay: true }
123123
);

versions/v19.0.0/sdk/audio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A static convenience method to construct and load a sound is also provided:
117117

118118
```javascript
119119
try {
120-
const { soundObject, status } = await Expo.Audio.Sound.create(
120+
const { sound: soundObject, status } = await Expo.Audio.Sound.create(
121121
require('./assets/sounds/hello.mp3'),
122122
{ shouldPlay: true }
123123
);

versions/v20.0.0/sdk/audio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A static convenience method to construct and load a sound is also provided:
117117

118118
```javascript
119119
try {
120-
const { soundObject, status } = await Expo.Audio.Sound.create(
120+
const { sound: soundObject, status } = await Expo.Audio.Sound.create(
121121
require('./assets/sounds/hello.mp3'),
122122
{ shouldPlay: true }
123123
);

versions/v21.0.0/sdk/audio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A static convenience method to construct and load a sound is also provided:
117117

118118
```javascript
119119
try {
120-
const { soundObject, status } = await Expo.Audio.Sound.create(
120+
const { sound: soundObject, status } = await Expo.Audio.Sound.create(
121121
require('./assets/sounds/hello.mp3'),
122122
{ shouldPlay: true }
123123
);

versions/v22.0.0/sdk/audio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A static convenience method to construct and load a sound is also provided:
117117

118118
```javascript
119119
try {
120-
const { soundObject, status } = await Expo.Audio.Sound.create(
120+
const { sound: soundObject, status } = await Expo.Audio.Sound.create(
121121
require('./assets/sounds/hello.mp3'),
122122
{ shouldPlay: true }
123123
);

versions/v23.0.0/sdk/audio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A static convenience method to construct and load a sound is also provided:
117117

118118
```javascript
119119
try {
120-
const { soundObject, status } = await Expo.Audio.Sound.create(
120+
const { sound: soundObject, status } = await Expo.Audio.Sound.create(
121121
require('./assets/sounds/hello.mp3'),
122122
{ shouldPlay: true }
123123
);

versions/v24.0.0/sdk/audio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A static convenience method to construct and load a sound is also provided:
117117

118118
```javascript
119119
try {
120-
const { soundObject, status } = await Expo.Audio.Sound.create(
120+
const { sound: soundObject, status } = await Expo.Audio.Sound.create(
121121
require('./assets/sounds/hello.mp3'),
122122
{ shouldPlay: true }
123123
);

versions/v25.0.0/sdk/audio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A static convenience method to construct and load a sound is also provided:
117117

118118
```javascript
119119
try {
120-
const { soundObject, status } = await Expo.Audio.Sound.create(
120+
const { sound: soundObject, status } = await Expo.Audio.Sound.create(
121121
require('./assets/sounds/hello.mp3'),
122122
{ shouldPlay: true }
123123
);

versions/v26.0.0/sdk/audio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A static convenience method to construct and load a sound is also provided:
117117

118118
```javascript
119119
try {
120-
const { soundObject, status } = await Expo.Audio.Sound.create(
120+
const { sound: soundObject, status } = await Expo.Audio.Sound.create(
121121
require('./assets/sounds/hello.mp3'),
122122
{ shouldPlay: true }
123123
);

versions/v27.0.0/sdk/audio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A static convenience method to construct and load a sound is also provided:
117117

118118
```javascript
119119
try {
120-
const { soundObject, status } = await Expo.Audio.Sound.create(
120+
const { sound: soundObject, status } = await Expo.Audio.Sound.create(
121121
require('./assets/sounds/hello.mp3'),
122122
{ shouldPlay: true }
123123
);

versions/v28.0.0/sdk/audio.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ A static convenience method to construct and load a sound is also provided:
117117

118118
```javascript
119119
try {
120-
const { soundObject, status } = await Expo.Audio.Sound.create(
120+
const { sound: soundObject, status } = await Expo.Audio.Sound.create(
121121
require('./assets/sounds/hello.mp3'),
122122
{ shouldPlay: true }
123123
);

0 commit comments

Comments
 (0)