Coder Social home page Coder Social logo

geprog / use-feathers Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 2.0 332 KB

Vue.js compositions for Feathers

Home Page: https://www.npmjs.com/package/@geprog/use-feathers

License: MIT License

JavaScript 0.64% TypeScript 99.36%
feathersjs vuejs vuejs3

use-feathers's People

Contributors

anbraten avatar lukashass avatar mariusheine avatar raphaelschwinger avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

use-feathers's Issues

Prevent find from being executed

It would be nice if we could set the ref-value of a useFind query to something like null to prevent the find from searching. As soon as the query changes to undefined or some value it should start searching similar to the id behavior of useGet.

Support feathers pagination

Currently we expect all the responses from feathers to be an array of items. But feathers also have pagination in its adapter-commons. So we need to support this as well.

onItemChanged filtering

Looking at:

// remove item from the list if they have been on it before
data.value = data.value.filter((item) => getId(item) !== getId(changedItem));

and the corresponding test:

it('should listen to "patch" & "update" events and remove item from list when query is not matching anymore', () => {

This seems like a case that can not happen. When the query changes find is called and overrides data.value completely.

I stumbled across this because the test title mentions "when query is not matching anymore", but the test does not simulate a no longer matching query.
Additionally adding await nextTick(); before emitting the updated event breaks the test. That should not happen.

Expose unload function

It would be nice to export a function called unload which can be used to unload the event listeners manually.

invalid data after query updated

When you have a request like

const params = ref({ query: {} });
const { data } = useFind(service, params)`;

Then this request might take a while to respond.
When the params get updated while the first request is not yet finished e.g. by setting ref.value = { query: { _id: 123 } }
then a second request with the updated params is performed.

This second request is probably much faster than the first request which causes data to be [{ _id: 123, ...rest }].
When the first requests finishs afterwards data will be set to [...aLotOfItems] which means that the data is not fitting to the query anymore.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Approval

These branches will be created by Renovate only once you click their checkbox below.

  • chore(deps): update dependency @geprog/eslint-config to v1.1.2
  • chore(deps): update dependency jsdom to v20.0.3
  • chore(deps): update dependency semantic-release to v19.0.5
  • chore(deps): update feathers monorepo to v5.0.14 (@feathersjs/adapter-commons, @feathersjs/errors, @feathersjs/feathers)
  • chore(deps): update amannn/action-semantic-pull-request action to v3.7.0
  • chore(deps): update dependency @vue/test-utils to v2.4.3
  • chore(deps): update dependency c8 to v7.14.0
  • chore(deps): update dependency eslint to v8.56.0
  • chore(deps): update dependency prettier to v2.8.8
  • chore(deps): update dependency tsup to v5.12.9
  • chore(deps): update dependency typescript to v4.9.5
  • chore(deps): update dependency vite to v3.2.7
  • chore(deps): update dependency vitest to v0.34.6
  • chore(deps): update dependency vue to v3.4.10
  • chore(deps): update pnpm/action-setup action to v2.4.0
  • chore(deps): update actions/cache action to v3
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update actions/setup-node action to v4
  • chore(deps): update amannn/action-semantic-pull-request action to v5
  • chore(deps): update dependency @geprog/eslint-config to v2
  • chore(deps): update dependency @geprog/semantic-release-config to v2
  • chore(deps): update dependency c8 to v9
  • chore(deps): update dependency jsdom to v23
  • chore(deps): update dependency prettier to v3
  • chore(deps): update dependency semantic-release to v22
  • chore(deps): update dependency tsup to v8
  • chore(deps): update dependency typescript to v5
  • chore(deps): update dependency vite to v5
  • chore(deps): update dependency vitest to v1
  • chore(deps): update pnpm to v8
  • fix(deps): update dependency sift to v17
  • ๐Ÿ” Create all pending approval PRs at once ๐Ÿ”

Detected dependencies

github-actions
.github/workflows/lint-pr.yml
  • amannn/action-semantic-pull-request v3.4.0
.github/workflows/release.yml
  • actions/checkout v2
  • actions/setup-node v2
  • actions/cache v2
  • pnpm/action-setup v2.0.1
.github/workflows/tests.yml
  • actions/checkout v2
  • actions/setup-node v2
  • actions/cache v2
  • pnpm/action-setup v2.0.1
  • actions/checkout v2
  • actions/setup-node v2
  • actions/cache v2
  • pnpm/action-setup v2.0.1
  • actions/checkout v2
  • actions/setup-node v2
  • actions/cache v2
  • pnpm/action-setup v2.0.1
  • actions/checkout v2
  • actions/setup-node v2
  • actions/cache v2
  • pnpm/action-setup v2.0.1
npm
package.json
  • sift ^15.0.0
  • @feathersjs/adapter-commons 5.0.0-pre.15
  • @feathersjs/errors 5.0.0-pre.15
  • @feathersjs/feathers 5.0.0-pre.15
  • @geprog/eslint-config 1.1.0
  • @geprog/semantic-release-config 1.0.0
  • @vue/test-utils 2.0.0
  • c8 7.11.3
  • eslint 8.8.0
  • jsdom 20.0.0
  • prettier 2.5.1
  • semantic-release 19.0.3
  • tsup 5.11.13
  • typescript 4.5.5
  • vite 3.0.3
  • vitest 0.19.1
  • vue 3.2.37
  • @feathersjs/adapter-commons ^5.0.0-pre.3
  • @feathersjs/feathers ^5.0.0-pre.3
  • vue ^3.0.11
  • pnpm 7

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.