Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 50
- getPage || 1
- id = getId || null
- getIdIndex || 0
- LastSyncPoint = getPage * 50 + getIdIndex
- api request /page/getPage[getIndex] ? inSync = true : inSync = false
- offset = find(id)
- find = getPage && getPage -1 && getPage + 1
- if getPage == currPage
- offset = indexOf currPage[id] - index Of getPage[id]
- ==========
- add to db keep adding
- 1 table filled out
- 1 table from api
- page stopped at
- preload
- 10 image thumbnails
- page1[0]
- page2[0]
- offset = where is page1[0].id now? page2? page3? keep going till you find it.
- while you doing that filter out which ids already filled out
- always check page 1
- page1[0] page1[49]
- last.page1[0] == curr.page1[0]?
- if yes, continue where you left off
- else
- offset = id.indexOf(curr.page1[i])
- 1
- ---
- 1
- 2
- 3
- 4x
- ..
- 50x
- 2
- ---
- 51x
- 52x <--here
- ..
- 100
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement