Skip to content

Instantly share code, notes, and snippets.

@Origho-precious
Created September 16, 2021 20:56
Show Gist options
  • Save Origho-precious/864dd880b4f1cf2011540d41f5603347 to your computer and use it in GitHub Desktop.
Save Origho-precious/864dd880b4f1cf2011540d41f5603347 to your computer and use it in GitHub Desktop.
slicedAnimeTitles
export const slicedAnimeTitles = selector({
key: "slicedAnimeTitles",
get: ({ get }) => {
const animes = get(animeTitles);
const pageNum = get(animeListPageNum);
const newAnimeList = [...animes];
const arrIndex = pageNum === 0 ? 0 : pageNum * 50 + 1;
return newAnimeList.splice(arrIndex, 50);
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment