Open swilgosz opened 4 years ago
Currently, to get the paginator, we need to instantiate the object in the index class.
paginator = JSOM::Pagination::Paginator.new paginated = paginator.call(collection, params: { number: 2, size: 3 }, base_ur: 'https://example.com')
It would be nice to instantiate it once during the application boot and allow to reuse the same object whenever it's needed. We could use dry-system for that:
dry-system
include JSOM::Pagination::Import['paginator'] paginated = paginator.call(collection, params: { number: 2, size: 3 }, base_ur: 'https://example.com')
Currently, to get the paginator, we need to instantiate the object in the index class.
It would be nice to instantiate it once during the application boot and allow to reuse the same object whenever it's needed. We could use
dry-system
for that: