Skip to content

User-provided fetch function #315

@jycouet

Description

@jycouet

I started to use your nice lib and I just hit https://svelecte.vercel.app/fetch#user-provided-fetch-function

I'm using https://remult.dev/ and I would love to be able to do

pseudo code:

<script>
  import { repo } from 'remult'
  import { Sale } from '../shared'
</script>

<Svelecte
	getStuff={async (str) => {
		const data = await repo(Sale).find({ name: { $contains: str }, type: 'BEST' })
        return data.map(c=> { return { id: c.id, label: c.name } } )
	}}
></Svelecte>

Also, with svelte remote functions I think that this need might comeback.

What's your opinion ? :)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions