Skip to content

createInstance not calling the function #14

@marius-c

Description

@marius-c

Hello,

I'm doing something wrong and I'm unable to figure it out.

async function fetchVideos(opts) {
    let data = Vue.axios.get('videos', { params: opts })
        .then(response => response.data)

    return {
        total: data.length,
        data: data
    };
}
createResource('videos', fetchVideos)

did a test in a component mounted()

createInstance('videos', {
                page: 1,
                pageSize: 10,
                args() {
                    return { sort: 'likes'}
                }
})

the above doesn't produce any call to the fetchVideos function, but if I do

resource('videos').fetchRange({page: 1, pageSize: 20})

it gets called. what am I missing ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions