[{"data":1,"prerenderedAt":434},["ShallowReactive",2],{"navigation_docs":3,"-basic-overview-what-does-the-pageable-actually-do":33,"-basic-overview-what-does-the-pageable-actually-do-surround":432},[4,20],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Quick Start",false,"\u002Fquick-start","1.quick-start",[10,15],{"title":11,"path":12,"stem":13,"icon":14},"Installation","\u002Fquick-start\u002Finstallation","1.quick-start\u002Finstallation","i-lucide-download",{"title":16,"path":17,"stem":18,"icon":19},"Setup and Usage","\u002Fquick-start\u002Fsetup-and-usage","1.quick-start\u002Fsetup-and-usage","i-lucide-folder-tree",{"title":21,"icon":6,"path":22,"stem":23,"children":24,"page":6},"Basic Overview","\u002Fbasic-overview","basic-overview",[25,29],{"title":26,"path":27,"stem":28},"Pageable Strategies","\u002Fbasic-overview\u002Fpageable-strategies","basic-overview\u002Fpageable-strategies",{"title":30,"path":31,"stem":32},"What does the Pageable actually do?","\u002Fbasic-overview\u002Fwhat-does-the-pageable-actually-do","basic-overview\u002Fwhat-does-the-pageable-actually-do",{"id":34,"title":30,"body":35,"description":426,"extension":427,"links":426,"meta":428,"navigation":176,"path":31,"seo":429,"stem":32,"__hash__":431},"docs\u002Fbasic-overview\u002Fwhat-does-the-pageable-actually-do.md",{"type":36,"value":37,"toc":421},"minimark",[38,43,47,66,69,83,90,96,100,122,125,129,132,400,403,408,411,417],[39,40,42],"h2",{"id":41},"the-pageable-represents-a-paged-data-source","The pageable represents a paged data source",[44,45,46],"p",{},"It provides you with:",[48,49,50,54,57,60,63],"ul",{},[51,52,53],"li",{},"A list of relevant items from your pages",[51,55,56],{},"The loading states in each direction",[51,58,59],{},"The tools to notify the engine about visible pages",[51,61,62],{},"To activate a specific page (usually referred to as \"jumping\")",[51,64,65],{},"etc.",[44,67,68],{},"Internally it creates the paginator engine, which takes care of:",[48,70,71,74,77,80],{},[51,72,73],{},"Storage",[51,75,76],{},"Lifecycle of pages",[51,78,79],{},"Page loading decisions",[51,81,82],{},"Concurrent page updates",[84,85],"card",{"icon":86,"title":87,"to":88,"target":89},"i-lucide-code","Pageable in API Reference","..\u002Fother\u002Fdokka\u002Flibraries\u002Fcore\u002Fcom.nxoim.evolpagink.core\u002F-pageable\u002Findex.html","_blank",[84,91,95],{"icon":92,"title":93,"to":94},"i-lucide-eye","Pageable Strategies Overview","pageable-strategies","Basic overview of the predefined strategies and how UI interacts with them",[39,97,99],{"id":98},"the-data-flow-looks-like-this","The data flow looks like this:",[101,102,104,107,110,113,116,119],"ol",{"start":103},0,[51,105,106],{},"UI appears, the collection of pageable items starts",[51,108,109],{},"Load initial page",[51,111,112],{},"UI tells paginator whats visible",[51,114,115],{},"Paginator uses the specified strategy to calculate pages to serve",[51,117,118],{},"The pages are requested and loaded, and the storage has their items deduplicated using the specified page item key factory",[51,120,121],{},"Repeat from point 2 unless the UI state is idle",[44,123,124],{},"When unsubscribed and resubscribed to the pageable, which may be the case during navigation, the page items stay cached, but all the work stops.",[39,126,128],{"id":127},"page-loading-may-be-contextual","Page loading may be contextual",[44,130,131],{},"The context may be a search query, or a filter, or something else entirely, stored as a StateFlow. When it emits a new value, the fetching restarts from initial page, and after the new page data is loaded all previously cached pages are cleared. This makes search, filters, and sorting seamless.",[133,134,139],"pre",{"className":135,"code":136,"language":137,"meta":138,"style":138},"language-kotlin shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","val songRetrievalContext = MutableStateFlow(SongRetrievalContext())\n\nval pageable = pageable(\n    coroutineScope = coroutineScope,\n    context = songRetrievalContext,\n    onPage = { page -> \u002F\u002F context accessible via `this`\n        songSource.getSongs(\n            index = page,\n            context = this\n        )\n    },\n    strategy = prefetchMinimumItemAmount(),\n    pageItemKey = { item -> item.id }\n)\n\ndata class SongRetrievalContext(\n    val searchQuery: String = \"\",\n    val filters: Filters = Filters(),\n    val sorting: Sorting = Sorting()\n)\n","kotlin","",[140,141,142,171,178,194,205,216,235,246,257,268,274,280,294,310,316,321,336,358,376,395],"code",{"__ignoreMap":138},[143,144,147,151,155,158,162,165,168],"span",{"class":145,"line":146},"line",1,[143,148,150],{"class":149},"sMK4o","val",[143,152,154],{"class":153},"sTEyZ"," songRetrievalContext ",[143,156,157],{"class":149},"=",[143,159,161],{"class":160},"s2Zo4"," MutableStateFlow",[143,163,164],{"class":153},"(",[143,166,167],{"class":160},"SongRetrievalContext",[143,169,170],{"class":153},"())\n",[143,172,174],{"class":145,"line":173},2,[143,175,177],{"emptyLinePlaceholder":176},true,"\n",[143,179,181,183,186,188,191],{"class":145,"line":180},3,[143,182,150],{"class":149},[143,184,185],{"class":153}," pageable ",[143,187,157],{"class":149},[143,189,190],{"class":160}," pageable",[143,192,193],{"class":153},"(\n",[143,195,197,200,202],{"class":145,"line":196},4,[143,198,199],{"class":153},"    coroutineScope ",[143,201,157],{"class":149},[143,203,204],{"class":153}," coroutineScope,\n",[143,206,208,211,213],{"class":145,"line":207},5,[143,209,210],{"class":153},"    context ",[143,212,157],{"class":149},[143,214,215],{"class":153}," songRetrievalContext,\n",[143,217,219,222,224,227,231],{"class":145,"line":218},6,[143,220,221],{"class":153},"    onPage ",[143,223,157],{"class":149},[143,225,226],{"class":153}," { page ",[143,228,230],{"class":229},"spNyl","->",[143,232,234],{"class":233},"sHwdD"," \u002F\u002F context accessible via `this`\n",[143,236,238,241,244],{"class":145,"line":237},7,[143,239,240],{"class":153},"        songSource.",[143,242,243],{"class":160},"getSongs",[143,245,193],{"class":153},[143,247,249,252,254],{"class":145,"line":248},8,[143,250,251],{"class":153},"            index ",[143,253,157],{"class":149},[143,255,256],{"class":153}," page,\n",[143,258,260,263,265],{"class":145,"line":259},9,[143,261,262],{"class":153},"            context ",[143,264,157],{"class":149},[143,266,267],{"class":149}," this\n",[143,269,271],{"class":145,"line":270},10,[143,272,273],{"class":153},"        )\n",[143,275,277],{"class":145,"line":276},11,[143,278,279],{"class":153},"    },\n",[143,281,283,286,288,291],{"class":145,"line":282},12,[143,284,285],{"class":153},"    strategy ",[143,287,157],{"class":149},[143,289,290],{"class":160}," prefetchMinimumItemAmount",[143,292,293],{"class":153},"(),\n",[143,295,297,300,302,305,307],{"class":145,"line":296},13,[143,298,299],{"class":153},"    pageItemKey ",[143,301,157],{"class":149},[143,303,304],{"class":153}," { item ",[143,306,230],{"class":229},[143,308,309],{"class":153}," item.id }\n",[143,311,313],{"class":145,"line":312},14,[143,314,315],{"class":153},")\n",[143,317,319],{"class":145,"line":318},15,[143,320,177],{"emptyLinePlaceholder":176},[143,322,324,327,330,334],{"class":145,"line":323},16,[143,325,326],{"class":229},"data",[143,328,329],{"class":149}," class",[143,331,333],{"class":332},"sBMFI"," SongRetrievalContext",[143,335,193],{"class":153},[143,337,339,342,345,348,351,355],{"class":145,"line":338},17,[143,340,341],{"class":149},"    val",[143,343,344],{"class":153}," searchQuery: ",[143,346,347],{"class":332},"String",[143,349,350],{"class":149}," =",[143,352,354],{"class":353},"sfazB"," \"\"",[143,356,357],{"class":153},",\n",[143,359,361,363,366,369,371,374],{"class":145,"line":360},18,[143,362,341],{"class":149},[143,364,365],{"class":153}," filters: ",[143,367,368],{"class":332},"Filters",[143,370,350],{"class":149},[143,372,373],{"class":160}," Filters",[143,375,293],{"class":153},[143,377,379,381,384,387,389,392],{"class":145,"line":378},19,[143,380,341],{"class":149},[143,382,383],{"class":153}," sorting: ",[143,385,386],{"class":332},"Sorting",[143,388,350],{"class":149},[143,390,391],{"class":160}," Sorting",[143,393,394],{"class":153},"()\n",[143,396,398],{"class":145,"line":397},20,[143,399,315],{"class":153},[44,401,402],{},"See the following code for the full example.",[84,404,407],{"icon":86,"title":405,"to":406,"target":89},"Sample App Code","https:\u002F\u002Fgithub.com\u002Fnxoim\u002Fevolpagink\u002Fblob\u002Fmain\u002Fsample\u002Fshared\u002Fsrc\u002FcommonMain\u002Fkotlin\u002Fcom\u002Fnxoim\u002Fsample\u002Fui\u002FModel.kt","Example usage within a screen's model",[44,409,410],{},"You can also try out the sample app.",[84,412,416],{"icon":413,"title":414,"to":415,"target":89},"i-lucide-layout-grid","Sample App","..\u002Fother\u002Fsample\u002Findex.html","Sample App in Compose Web (WasmJS)",[418,419,420],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":138,"searchDepth":173,"depth":173,"links":422},[423,424,425],{"id":41,"depth":173,"text":42},{"id":98,"depth":173,"text":99},{"id":127,"depth":173,"text":128},null,"md",{},{"title":430,"description":426},"evolpagink What does the Pageable actually do?","aqYv5n4uvZBWygL6b7_rpaqqMpIkvK3LejphFd_enPQ",[433,426],{"title":26,"path":27,"stem":28,"description":138,"children":-1},1785924974238]