Skip to content

Commit fc327ea

Browse files
committed
Add note about selectionDelay
1 parent 17b7d5b commit fc327ea

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

examples/simple/src/index.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,33 @@ import { ul, li, makeDOMDriver, DOMSource, VNode } from '@cycle/dom';
55
import { makeSortable } from '../../../src/makeSortable';
66

77
type Sources = {
8-
DOM : DOMSource;
8+
DOM: DOMSource;
99
};
1010

1111
type Sinks = {
12-
DOM : Stream<VNode>;
12+
DOM: Stream<VNode>;
1313
};
1414

15-
function main({ DOM } : Sources) : Sinks
16-
{
17-
const vdom$ : Stream<VNode> = xs.of(
18-
ul('.ul', [
19-
li('.li', '', ['Option 1']),
20-
li('.li', '', ['Option 2']),
21-
li('.li', '', ['Option 3']),
22-
li('.li', '', ['Option 4']),
23-
li('.li', '', ['Option 5']),
24-
li('.li', '', ['Option 6']),
25-
])
26-
)
27-
.compose(makeSortable<Stream<VNode>>(DOM, { ghostClass: '.ghost', selectionDelay: 500 }));
15+
function main({ DOM }: Sources): Sinks {
16+
const vdom$: Stream<VNode> = xs
17+
.of(
18+
ul('.ul', [
19+
li('.li', '', [
20+
'You have to hold for 500ms to start reordering'
21+
]),
22+
li('.li', '', ['Option 2']),
23+
li('.li', '', ['Option 3']),
24+
li('.li', '', ['Option 4']),
25+
li('.li', '', ['Option 5']),
26+
li('.li', '', ['Option 6'])
27+
])
28+
)
29+
.compose(
30+
makeSortable<Stream<VNode>>(DOM, {
31+
ghostClass: '.ghost',
32+
selectionDelay: 500
33+
})
34+
);
2835

2936
return {
3037
DOM: vdom$

0 commit comments

Comments
 (0)