Load missing events dynamically when browsing
kbups opened this issue · 2 comments
Thanks a lot for this plugin and all the works behind! I am using it since more than one year with no particular problem.
Today, I have a question about how to manage events coming from API. In order to not load all the entire database ;-) do you know how to have a callback when browsing weeks so that we can load missing events and add them to the timetable dynamically?
Thanks in advance for your reply.
Regards,
In the (not yet stable) rewrite for version 1.0.0, you supply an EventProvider<E extends Event>
function that is called whenever the visible range changes. If your events for the current range change, you can just rebuild the widget and supply your new events. (There's also #110 requesting a callback that is only invoked when the swiping is completed.)
In the 0.x.y versions, you can use EventProvider.stream(…)
that also takes a function that is called whenever the visible range changes. In both cases, you should probably cache the events locally because this function can be called a lot when navigating through different dates.
I hope this answers your question :) And sorry for the delay, the past three weeks were very stressful
Thanks a lot for your answer!
Because I use 0.x.y I will try to have a look at the EventProvider.stream(...)
and cache results locally.
Best regards!