@@ -25,7 +25,7 @@ export const machine = createMachine<AsyncListSchema<any, any, any, any>>({
2525 error : bindable < any > ( ( ) => ( {
2626 defaultValue : undefined ,
2727 } ) ) ,
28- isLoadMore : bindable < boolean > ( ( ) => ( {
28+ isLoadingMore : bindable < boolean > ( ( ) => ( {
2929 defaultValue : false ,
3030 } ) ) ,
3131 }
@@ -52,7 +52,7 @@ export const machine = createMachine<AsyncListSchema<any, any, any, any>>({
5252 RELOAD : {
5353 target : "loading" ,
5454 reenter : true ,
55- actions : [ "clearItems" , "clearIsLoadMore " ] ,
55+ actions : [ "clearItems" , "clearIsLoadingMore " ] ,
5656 } ,
5757 } ,
5858
@@ -64,22 +64,22 @@ export const machine = createMachine<AsyncListSchema<any, any, any, any>>({
6464 LOAD_MORE : {
6565 guard : "hasCursor" ,
6666 target : "loading" ,
67- actions : [ "setIsLoadMore " ] ,
67+ actions : [ "setIsLoadingMore " ] ,
6868 } ,
6969 SORT : [
7070 {
7171 guard : "hasSortFn" ,
7272 target : "sorting" ,
73- actions : [ "setSorting" , "clearCursor" , "clearIsLoadMore " , "performSort" ] ,
73+ actions : [ "setSorting" , "clearCursor" , "clearIsLoadingMore " , "performSort" ] ,
7474 } ,
7575 {
7676 target : "loading" ,
77- actions : [ "setSorting" , "clearCursor" , "clearIsLoadMore " ] ,
77+ actions : [ "setSorting" , "clearCursor" , "clearIsLoadingMore " ] ,
7878 } ,
7979 ] ,
8080 FILTER : {
8181 target : "loading" ,
82- actions : [ "setFilter" , "clearCursor" , "clearIsLoadMore " ] ,
82+ actions : [ "setFilter" , "clearCursor" , "clearIsLoadingMore " ] ,
8383 } ,
8484 } ,
8585 } ,
@@ -102,7 +102,7 @@ export const machine = createMachine<AsyncListSchema<any, any, any, any>>({
102102 FILTER : {
103103 reenter : true ,
104104 target : "loading" ,
105- actions : [ "setFilter" , "clearCursor" , "clearIsLoadMore " ] ,
105+ actions : [ "setFilter" , "clearCursor" , "clearIsLoadingMore " ] ,
106106 } ,
107107 } ,
108108 } ,
@@ -122,22 +122,22 @@ export const machine = createMachine<AsyncListSchema<any, any, any, any>>({
122122 } ,
123123 FILTER : {
124124 target : "loading" ,
125- actions : [ "setFilter" , "clearCursor" , "cancelSort" , "clearIsLoadMore " ] ,
125+ actions : [ "setFilter" , "clearCursor" , "cancelSort" , "clearIsLoadingMore " ] ,
126126 } ,
127127 RELOAD : {
128128 target : "loading" ,
129- actions : [ "clearItems" , "cancelSort" , "clearIsLoadMore " ] ,
129+ actions : [ "clearItems" , "cancelSort" , "clearIsLoadingMore " ] ,
130130 } ,
131131 SORT : [
132132 {
133133 guard : "hasSortFn" ,
134134 target : "sorting" ,
135135 reenter : true ,
136- actions : [ "setSorting" , "clearCursor" , "cancelSort" , "clearIsLoadMore " , "performSort" ] ,
136+ actions : [ "setSorting" , "clearCursor" , "cancelSort" , "clearIsLoadingMore " , "performSort" ] ,
137137 } ,
138138 {
139139 target : "loading" ,
140- actions : [ "setSorting" , "clearCursor" , "cancelSort" , "clearIsLoadMore " ] ,
140+ actions : [ "setSorting" , "clearCursor" , "cancelSort" , "clearIsLoadingMore " ] ,
141141 } ,
142142 ] ,
143143 } ,
@@ -160,12 +160,12 @@ export const machine = createMachine<AsyncListSchema<any, any, any, any>>({
160160 send ( { type : "RELOAD" } )
161161 } ,
162162
163- setIsLoadMore ( { context } ) {
164- context . set ( "isLoadMore " , true )
163+ setIsLoadingMore ( { context } ) {
164+ context . set ( "isLoadingMore " , true )
165165 } ,
166166
167- clearIsLoadMore ( { context } ) {
168- context . set ( "isLoadMore " , false )
167+ clearIsLoadingMore ( { context } ) {
168+ context . set ( "isLoadingMore " , false )
169169 } ,
170170
171171 performFetch ( { context, prop, refs, send, event } ) {
@@ -176,19 +176,19 @@ export const machine = createMachine<AsyncListSchema<any, any, any, any>>({
176176 const seq = refs . get ( "seq" ) + 1
177177 refs . set ( "seq" , seq )
178178
179- const isLoadMore = context . get ( "isLoadMore " )
179+ const isLoadingMore = context . get ( "isLoadingMore " )
180180
181181 const loadFn = prop ( "load" )
182182 loadFn ( {
183183 signal : abort ?. signal ,
184184 items : context . get ( "items" ) ,
185- cursor : isLoadMore ? context . get ( "cursor" ) : null ,
185+ cursor : isLoadingMore ? context . get ( "cursor" ) : null ,
186186 filter : event . filter ?? context . get ( "filter" ) ,
187187 sorting : event . sorting ?? context . get ( "sorting" ) ,
188188 } )
189189 . then ( ( { items, cursor } ) => {
190190 if ( seq !== refs . get ( "seq" ) ) return
191- send ( { type : "SUCCESS" , items, cursor, append : isLoadMore } )
191+ send ( { type : "SUCCESS" , items, cursor, append : isLoadingMore } )
192192 } )
193193 . catch ( ( error ) => {
194194 if ( seq !== refs . get ( "seq" ) ) return
0 commit comments