3.3.5 • Published 10 months ago

@geprog/use-feathers v3.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

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 };
  },
});
3.3.5

10 months ago

3.3.4

10 months ago

3.3.3

2 years ago

3.3.2

2 years ago

3.3.1

3 years ago

3.3.0

4 years ago

3.2.2

4 years ago

3.2.1

4 years ago

3.2.3

4 years ago

3.2.0

4 years ago

3.1.4

4 years ago

3.1.3

4 years ago

3.1.2

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

1.0.0

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

0.3.0

4 years ago

0.3.1

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

0.2.1

4 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.1.1

5 years ago

0.0.1

5 years ago