@geprog/use-feathers
TypeScript icon, indicating that this package has built-in type declarations

3.3.3 • Public • Published

Vue.js compositions for Feathers

Provides get and find compositions that let you query your feathers API.
Queries and responses are fully reactive allowing you to:

  • trigger a query by simply updating a query parameter
  • receive continuous updates via @feathersjs/socketio-client that are instantly visible inside Vue components.

Example usage

Define a wrapper that passes your feathers app.
Passing your Application type including your ServiceTypes allows typechecking of the serviceName parameter.

// useFindWrapper.ts
import { useFind } from '@geprog/use-feathers';
import { Application as FeathersApplication } from '@feathersjs/feathers';
import { AdapterService } from '@feathersjs/adapter-commons';
import { Car } from './model';

type ServiceTypes = {
  cars: AdapterService<Car>;
};

type Application = FeathersApplication<ServiceTypes>;

export const useFindWrapper = useFind<Application>(yourFeathersApp);

Inside a Vue component call the wrapper with a serviceName and a Params ref containing your query.

import { computed, defineComponent } from 'vue';
import { useFindWrapper } from './useFindWrapper';

export default defineComponent({
  setup() {
    const seats = ref(4);
    const { data: cars, isLoading } = useFindWrapper(
      'cars',
      computed(() => ({ paginate: false, query: { seats: seats.value } })),
    );
    return { seats, cars, isLoading };
  },
});

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.3.313latest

Version History

VersionDownloads (Last 7 Days)Published
3.3.313
3.3.21
3.3.111
3.3.02
3.2.31
3.2.21
3.2.11
3.2.01
3.1.41
3.1.31
3.1.21
3.1.11
3.1.01
3.0.11
3.0.01
2.0.31
2.0.21
2.0.11
2.0.01
1.0.02
0.3.11
0.3.01
0.2.11
0.2.01
0.1.11
0.1.01
0.0.11

Package Sidebar

Install

npm i @geprog/use-feathers

Homepage

geprog.com

Weekly Downloads

51

Version

3.3.3

License

MIT

Unpacked Size

24.4 kB

Total Files

6

Last publish

Collaborators

  • mariusheine
  • troyv2
  • geprog-npm
  • anbraten
  • lukasbeta