Without providing a fully working example, instead of having a Pagination object, you merely use a pure function (same input always produces same output) to calculate the pagination that should be displayed:
constgetPagination=(currentPage,pages,showPages)=>{constpagination=[];// ...do the calculationreturnpagination;};
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey thanks for the feedback. I didn't quite get the functional approach. Can you elaborate a bit more for my benefit ?
Without providing a fully working example, instead of having a Pagination object, you merely use a pure function (same input always produces same output) to calculate the pagination that should be displayed: