Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/team-griffin/redux-clipboard
https://github.com/team-griffin/redux-clipboard
clipboard react redux
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/team-griffin/redux-clipboard
- Owner: team-griffin
- License: mit
- Created: 2017-03-25T09:46:47.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-07T10:52:10.000Z (almost 7 years ago)
- Last Synced: 2024-10-30T02:55:39.057Z (about 2 months ago)
- Topics: clipboard, react, redux
- Language: JavaScript
- Size: 107 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redux-clipboard
```sh
npm install --save @team-griffin/redux-clipboard
```
```sh
yarn add @team-griffin/redux-clipboard
```This library allows you to copy a given value to the clipboard. It uses `execCommand('copy')` which is 100% supported. If your application needs a fallback this library is not for you.
## Requirements
- most
- redux-most## Setup
This library uses `redux-most` to handle its side effects.
```javascript
import { createEpicMiddleware, combineEpics } from 'redux-most';
import { epics as reduxClipboardEpics } from '@team-griffin/redux-clipboard';createEpicMiddleware(combineEpics([
reduxClipboardEpics,
]));
```## Usage
```javascript
import { signals } from '@team-griffin/redux-clipboard';dispatch(signals.copy('my content'));
```This will copy to the clipboard for you. If you want to perform more actions after the copy has taken place this library supplies 2 messages.
```javascript
import { messages } from '@team-griffin/redux-clipboard';messages.COPY_SUCCESS;
messages.COPY_FAILURE;
```