https://github.com/arlac77/svelte-command
"general command execution handling for svelte components"
https://github.com/arlac77/svelte-command
svelte
Last synced: about 1 year ago
JSON representation
"general command execution handling for svelte components"
- Host: GitHub
- URL: https://github.com/arlac77/svelte-command
- Owner: arlac77
- License: 0bsd
- Created: 2021-01-18T19:39:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-09T19:53:43.000Z (about 1 year ago)
- Last Synced: 2025-04-09T20:20:14.874Z (about 1 year ago)
- Topics: svelte
- Language: JavaScript
- Homepage:
- Size: 16.6 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://svelte.dev)
[](https://www.npmjs.com/package/svelte-command)
[](https://spdx.org/licenses/0BSD.html)
[](https://bundlejs.com/?q=svelte-command)
[](https://npmjs.org/package/svelte-command)
[](https://github.com/arlac77/svelte-command/issues)
[](https://actions-badge.atrox.dev/arlac77/svelte-command/goto)
[](https://github.com/prettier/prettier)
[](http://commitizen.github.io/cz-cli/)
[](https://snyk.io/test/github/arlac77/svelte-command)
[](https://coveralls.io/github/arlac77/svelte-command)
[](https://github.com/DevExpress/testcafe)
# svelte-command
general command execution handling for svelte components
# API
### Table of Contents
* [BasicCommand](#basiccommand)
* [Parameters](#parameters)
* [subscribe](#subscribe)
* [Parameters](#parameters-1)
* [Command](#command)
* [Parameters](#parameters-2)
* [Properties](#properties)
* [ConfirmCommand](#confirmcommand)
* [Parameters](#parameters-3)
* [FetchCommand](#fetchcommand)
* [Parameters](#parameters-4)
* [handleFailedResponse](#handlefailedresponse)
* [Parameters](#parameters-5)
## BasicCommand
### Parameters
* `start`
* `properties`
* `options` (optional, default `{}`)
### subscribe
#### Parameters
* `subscription` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**
## Command
**Extends BasicCommand**
### Parameters
* `_start`
* `options` (optional, default `{}`)
### Properties
* `title` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
* `description` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
* `shortcuts` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
* `disabled` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
* `active` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
* `failed` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
* `completed` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
## ConfirmCommand
**Extends BasicCommand**
Ask for confirmation before execution a given Command.
### Parameters
* `command`
## FetchCommand
**Extends Command**
Command executing a fetch request.
### Parameters
* `url` **any**
* `fetchOptions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
## handleFailedResponse
Extract error description from response.
### Parameters
* `response` **[Response](https://developer.mozilla.org/docs/Web/Guide/HTML/HTML5)**
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>**
# install
With [npm](http://npmjs.org) do:
```shell
npm install svelte-command
```
With [yarn](https://yarnpkg.com) do:
```shell
yarn add svelte-command
```
# license
BSD-2-Clause