<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using AbortControllers with Spotify SDK in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Using-AbortControllers-with-Spotify-SDK/m-p/5580544#M9203</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Plan&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Premium&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Country&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;United States&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MacBook Pro 2020 T2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Operating System&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;macOS Monterey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Question or Issue&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm curious if anyone has experience using signals and/or AbortController() with the Spotify SDK's addListener and removeListener functionality to programmatically cancel listeners.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a React app that plays Spotify songs requested via PUT request to the Spotify API, then played and paused through the SDK. At the moment, I have a roughly cobbled-together listener for track end (please create a dedicated SDK track-end listener, Spotify) that listens for changes to player_state, and if a series of changes occur to state, then the listener invokes a callback to request the next track.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment, this listener registers each time a Spotify track is played, resulting in a ridiculous number of listeners if a user plays a series of songs. Does anyone have experience canceling these with an AbortController? And if so, how would one do so, since the SDK listener doesn't accept an options object?&lt;/P&gt;</description>
    <pubDate>Sat, 13 May 2023 19:37:45 GMT</pubDate>
    <dc:creator>jfk52917</dc:creator>
    <dc:date>2023-05-13T19:37:45Z</dc:date>
    <item>
      <title>Using AbortControllers with Spotify SDK</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Using-AbortControllers-with-Spotify-SDK/m-p/5580544#M9203</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Plan&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Premium&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Country&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;United States&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MacBook Pro 2020 T2&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Operating System&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;macOS Monterey&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Question or Issue&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I'm curious if anyone has experience using signals and/or AbortController() with the Spotify SDK's addListener and removeListener functionality to programmatically cancel listeners.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a React app that plays Spotify songs requested via PUT request to the Spotify API, then played and paused through the SDK. At the moment, I have a roughly cobbled-together listener for track end (please create a dedicated SDK track-end listener, Spotify) that listens for changes to player_state, and if a series of changes occur to state, then the listener invokes a callback to request the next track.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment, this listener registers each time a Spotify track is played, resulting in a ridiculous number of listeners if a user plays a series of songs. Does anyone have experience canceling these with an AbortController? And if so, how would one do so, since the SDK listener doesn't accept an options object?&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2023 19:37:45 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Using-AbortControllers-with-Spotify-SDK/m-p/5580544#M9203</guid>
      <dc:creator>jfk52917</dc:creator>
      <dc:date>2023-05-13T19:37:45Z</dc:date>
    </item>
  </channel>
</rss>

