Skip to content

Commit

Permalink
fix: update README formatting and improve code readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Spikeysanju committed Nov 10, 2024
1 parent c89f8c0 commit 61789c8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# SvelteDnD

[![npm version](https://img.shields.io/npm/v/@thisux/sveltednd.svg)](https://www.npmjs.com/package/@thisux/sveltednd)

A lightweight drag and drop library for Svelte 5 applications. Built with TypeScript and Svelte's new runes system.

## Installation
Expand Down Expand Up @@ -264,19 +262,21 @@ interface DragDropState<T = unknown> {
// Handle the drop action
// For example, move the item to a different category or list
items = items.map(item =>
items = items.map((item) =>
item.id === draggedItem.id ? { ...item, category: targetContainer } : item
);
}
</script>
<div use:droppable={{
container: 'filtered',
callbacks: {
onDragOver: handleDragOver,
onDrop: handleDrop
}
}}>
<div
use:droppable={{
container: 'filtered',
callbacks: {
onDragOver: handleDragOver,
onDrop: handleDrop
}
}}
>
{#each items as item}
<div use:draggable={{ container: 'filtered', dragData: item }}>
{item.name}
Expand Down

0 comments on commit 61789c8

Please sign in to comment.