Skip to content

Populating drop downs with large (dynamic) datasets #517

Answered by ajnsn
mattkingshott asked this question in Help
Discussion options

You must be logged in to vote

@mattkingshott Afaik there's no real issue passing large data with the initial page load. If the initial page load slows down the app, I often use lazy data evaluation. Please take a look at the Lazy data evaluation of the documentation, e.g. the example with lazily loading users with Laravel:

return Inertia::render('Users/Index', [
    // NEVER included on first visit
    // OPTIONALLY included on partial reloads
    // ONLY evaluated when needed
    'users' => Inertia::lazy(fn () => User::get()),
]);

When using Vue, you could load these users after the initial page load, like so:

this.$inertia.get('/users', {}, {
    preserveScroll: true,
    preserveState: true,
    only: ['users'],
});

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@reinink
Comment options

@mattkingshott
Comment options

Answer selected by reinink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants