@@ -44,7 +44,7 @@ export interface ConfigureSpec<D> {
44
44
getList : ( listId : any ) => Observable < Iterable < D > > ;
45
45
canDrag ?: ( data : D , listId : any ) => boolean ;
46
46
canDrop ?: ( item : DraggedItem < D > ) => boolean ;
47
- isDragging ?: ( self : D , other : DraggedItem < D > ) => boolean ;
47
+ isDragging ?: ( ground : D , inFlight : DraggedItem < D > ) => boolean ;
48
48
// copy?: (item: DraggedItem<T>) => boolean | T;
49
49
// clone?: (data: T) => T;
50
50
}
@@ -54,17 +54,19 @@ export class NgRxSortable<D> implements SortableSpec<D> {
54
54
public getList ! : ( listId : any ) => Observable < Iterable < D > > ;
55
55
public canDrag ?: ( data : D , listId : any ) => boolean ;
56
56
public canDrop ?: ( item : DraggedItem < D > ) => boolean ;
57
+ public isDragging ?: ( ground : D , inFlight : DraggedItem < D > ) => boolean ;
57
58
58
59
/**
59
60
* @param store An @ngrx store instance.
60
61
* @param actionType The type in your own @ngrx/store `ActionTypes` enum you want the sortable actions to use.
61
62
* @param configure You must provide `trackBy` and `getList` functions here. Hopefully your `getList` will select from the store you passed!
62
63
* */
63
- constructor ( private store : Dispatcher , public actionType : string , configure : ConfigureSpec < D > ) {
64
- this . trackBy = configure . trackBy ;
65
- this . getList = configure . getList ;
66
- this . canDrag = configure . canDrag ;
67
- this . canDrop = configure . canDrop ;
64
+ constructor ( protected store : Dispatcher , public actionType : string , configure : ConfigureSpec < D > ) {
65
+ if ( configure . trackBy ) this . trackBy = configure . trackBy ;
66
+ if ( configure . getList ) this . getList = configure . getList ;
67
+ if ( configure . canDrag ) this . canDrag = configure . canDrag ;
68
+ if ( configure . canDrop ) this . canDrop = configure . canDrop ;
69
+ if ( configure . isDragging ) this . isDragging = configure . isDragging ;
68
70
}
69
71
70
72
// We now implement the SortableSpec interface by dispatching actions
0 commit comments