You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me than to pass a valid slice to connectionFromArraySlice you basically need to know the start offset and end offset to make the slice bigger. Do you agree?
If yes, I'm happy to extract this piece into its own function and add tests :)
Cheers
The text was updated successfully, but these errors were encountered:
Sorry wrote that before going to bed... It is not specifically related to #82.
My point is that connectionFromArraySlice expects a slice that contains the elements it needs to populate the page. But you cannot know what those elements are without first going through the pagination algorithm. And right now the pagination algorithm is implemented directly in connectionFromArraySlice (vs factored out in its own function).
This leaves with 2 options when constructing the slice to pass to connectionFromArraySlice:
Come up with a heuristics / strategy to easily compute offsetStart and offsetEnd before calling connectionFromArraySlice,
Call connectionFromArraySlice with dummy data to extract offsetStart and offsetEnd, generate a slice based on these params and call again connectionFromArraySlice with the slice
Is this clearer?
If yes, happy to factor out this pagination algorithm (for a bounded array) into its own function :)
jnak
changed the title
What are the constrain on the slice passed to connectionFromArraySlice?
What are the constrains on the slice passed to connectionFromArraySlice?
May 2, 2016
Hello guys!
It seems to me than to pass a valid slice to connectionFromArraySlice you basically need to know the start offset and end offset to make the slice bigger. Do you agree?
If yes, I'm happy to extract this piece into its own function and add tests :)
Cheers
The text was updated successfully, but these errors were encountered: