--[[
	Returns a list of indexes of self.props.images to render. This is to support the circular list effect.
]]

modules.getRenderedIndexes = function(self)
	return function()
		local res = {}
		for i = -(2 * #self.props.images + self.state.offset), (2 * #self.props.images + self.state.offset) do
			local index = self.state.selectedIndex + i

			-- NOTE: Really dislike this modulo pattern for circular indexes.
			-- Taken from: https://stackoverflow.com/questions/52103713/alternative-to-modulus-in-lua
			index = (index + #self.props.images - 1) % #self.props.images + 1

			table.insert(res, index)
		end

		return res
	end
end
