@qnx/composables
v0.6.15
Published
@qnx/composables provides a collection of Vue composition utilities.
Downloads
80
Maintainers
Readme
@qnx/composables
@qnx/composables provides a collection of Vue composition utilities.
Installation
Use the package manager npm to install @qnx/composables.
npm install @qnx/composables
You can also use yarn, pnpm, or bun
yarn add @qnx/composables
pnpm install @qnx/composables
bun install @qnx/composables
Usage
Core Features
objectToFormData: Transforms an object into a FormData object.
import { objectToFormData } from '@qnx/composables'
const formData = objectToFormData({
name: 'foo',
profileImage: File Object
})
objectToQueryString: Transforms an object into a query string, useful for sending data in a URL.
import { objectToQueryString } from '@qnx/composables'
const queryString = objectToQueryString({
name: 'foo',
address: 'bar'
})
Integration Features
useAxios: Collects reactive data and the status of a request.
import { useAxios } from '@qnx/composables/axios'
const { response, loading, cancel } = useAxios('/user', { method: 'GET' })
useAsyncAxios: Collects data from a request asynchronously.
import { useAsyncAxios } from '@qnx/composables/axios'
const response = await useAsyncAxios('/user', { method: 'GET' })
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
MIT License © 2023-PRESENT Yatendra Kushwaha