electrolobzik
02/18/2024, 3:20 PMMatthew Ramotar
02/18/2024, 3:41 PMMatthew Ramotar
02/18/2024, 3:42 PMStoreKey
and StoreData
and provide a StoreMultiCache
implementation to StoreBuilder
Matthew Ramotar
02/18/2024, 3:43 PMelectrolobzik
02/18/2024, 3:52 PMStoreMultiCache
refers to the memoryCache
parameter of the Store
, correct? The fetcher
and sourceOfTruth
parameters both share the same Key
type, so if the API returns a list (no key) should this Key
be Unit
or Nothing
?Matthew Ramotar
02/18/2024, 4:06 PMStoreMultiCache
is passed in as the memory cache. The list should be associated with a key. Your fetcher and SOT should switch on the key and handle singles and collectionsMatthew Ramotar
02/18/2024, 4:06 PMTrails
has an example of this, 1 minMatthew Ramotar
02/18/2024, 4:08 PMelectrolobzik
02/18/2024, 6:14 PMelectrolobzik
02/18/2024, 7:11 PMval page: Int
instead of val page: Any
? In my case the pagination is implemented in DynamoDb and it uses composite String keys (nextPage
) which I have to utilise in the API. Is it possible to somehow use paging in this case?Matthew Ramotar
02/18/2024, 7:36 PMStoreKey.Collection.Page
key is intended for page-based fetches, where page number is typically an integer. Is nextPage
a string representation of an integer? What are example values? If you could share a sample API response, that would be helpfulelectrolobzik
02/18/2024, 9:03 PM{"count":1,"nextKey":"2024-02-17T19:34:28.722Z|4e6dc288-2cb0-441d-ba2b-9f2208adbf46", media: [...]}
I am not backend developer, but as I understood the key is a composite of columns used in the index, by which the pagination is performed. In this particular case pagination uses the key=date+guid, that’s why the nextKey value is basically a String with concatenation of values in these columns of the row, which should be the first in the next page.electrolobzik
02/18/2024, 9:04 PMMatthew Ramotar
02/18/2024, 9:07 PMCursor
keyelectrolobzik
02/19/2024, 7:47 AMelectrolobzik
02/19/2024, 7:51 AMelectrolobzik
02/19/2024, 9:31 AMCursor
but came across another issue. In StoreKey
the Id
type should be the same for Cursor and Single. In my case they are both String technically, but have absolutely different semantics (for cursor - it is a composite string from DynamoDb and for single it is an media ID, which is GUID. Just as an experiment I tried to set different type parameters for Cursor
and Id
and naturally got an error that the types are inconsistent. What is the motivation behind having the same Id
type for the Cursor
and Single
? In general they can be different imho and are different in my case.Matthew Ramotar
02/19/2024, 5:53 PMelectrolobzik
02/19/2024, 5:55 PMelectrolobzik
02/19/2024, 5:57 PMelectrolobzik
02/19/2024, 8:24 PMMatthew Ramotar
02/19/2024, 10:10 PMMatthew Ramotar
02/19/2024, 10:11 PMStoreKey.Collection
, but otherwise our impl doesn't care if it's customelectrolobzik
02/20/2024, 7:30 PMelectrolobzik
02/21/2024, 8:35 AMMatthew Ramotar
02/21/2024, 1:28 PMelectrolobzik
02/21/2024, 3:37 PMelectrolobzik
02/21/2024, 4:18 PMelectrolobzik
02/21/2024, 5:05 PMelectrolobzik
02/21/2024, 6:28 PMStoreKey
, because both Page
and Single
are unsuitable. And if we introduce third type of key, let’s say Heap
we will get even more pairs of incompatible pairs key-data in both fetcher and SOT.electrolobzik
02/21/2024, 6:38 PMPage
makes sense only for fetcher
and writer
, not for reader
. Single
- fetcher
(only if we have API), writer
and reader
. Heap
- only for reader
in general but probably could be enabled for fetcher
(and writer
as well with some effort.electrolobzik
02/22/2024, 9:25 AMMatthew Ramotar
02/27/2024, 3:17 PMelectrolobzik
02/27/2024, 3:27 PMMatthew Ramotar
02/27/2024, 3:31 PMMatthew Ramotar
02/27/2024, 4:10 PMMatthew Ramotar
02/27/2024, 4:11 PMelectrolobzik
02/27/2024, 4:16 PMMatthew Ramotar
03/01/2024, 11:59 PMelectrolobzik
03/03/2024, 1:13 PMelectrolobzik
03/03/2024, 1:13 PMMatthew Ramotar
03/04/2024, 5:10 PMMatthew Ramotar
03/04/2024, 5:11 PMelectrolobzik
03/04/2024, 5:49 PM