Skip to content

Commit

Permalink
Trottle instead of debounce in live client manage
Browse files Browse the repository at this point in the history
  • Loading branch information
dtcooper committed Aug 10, 2024
1 parent e5be650 commit 56bd5d6
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</article>
<p>
<button @click="logs = []">Clear logs</button>
<button :disabled="!connected" @click.debounce="send('reload-playlist')">
<button :disabled="!connected" @click.throttle.500ms="send('reload-playlist')">
Refresh ALL connected clients playlists
</button>
</p>
Expand Down Expand Up @@ -140,12 +140,14 @@
</td>
<td x-text="conn.username"></td>
<td>
<button @click.debounce="send('reload-playlist', {'connection_id': conn.connection_id})">
<button @click.throttle.500ms="send('reload-playlist', {'connection_id': conn.connection_id})">
Refresh playlist
</button>
<button @click.debounce="() => send('play', {'connection_id': conn.connection_id })">Play</button>
<button @click.throttle.500ms="() => send('play', {'connection_id': conn.connection_id })">
Play
</button>
<button
@click.debounce="() => {
@click.throttle.500ms="() => {
if(notifyMsg.trim().length > 0) {
send('notify', {'connection_id': conn.connection_id, msg: notifyMsg, level: notifyLevel})
notifyMsg = ''
Expand Down Expand Up @@ -258,11 +260,11 @@
<option>Select an asset above</option>
</select>
<button
@click.debounce="swapAsset(action, item.id, subindex)"
@click.throttle.500ms="swapAsset(action, item.id, subindex)"
x-text="`Perform ${action !== 'swap' ? 'insert ' : ''}${action}`"
:disabled="!asset"
></button>
<button @click.debounce="deleteAsset(item.id, subindex)">Delete</button>
<button @click.throttle.500ms="deleteAsset(item.id, subindex)">Delete</button>
</span>
</div>
</template>
Expand Down

0 comments on commit 56bd5d6

Please sign in to comment.