# laravel-echo-redux

> laravel-echo + redux

Latest version **1.0.4** (published 2020-04-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install laravel-echo-redux
pnpm add laravel-echo-redux
yarn add laravel-echo-redux
bun add laravel-echo-redux
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2020-04-21 |
| First published | 2020-04-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andrey-2210 |
| Maintainers | andrey-2210 |

## Links

- npm: https://www.npmjs.com/package/laravel-echo-redux
- Repository: https://github.com/Andrey-2210/laravel-echo-redux
- Homepage: https://github.com/Andrey-2210/laravel-echo-redux#readme
- Issues: https://github.com/Andrey-2210/laravel-echo-redux/issues
- npm.io page: https://npm.io/package/laravel-echo-redux

## Dependencies (2)

- [laravel-echo](https://npm.io/package/laravel-echo.md) ^1.7.0
- [socket.io-client](https://npm.io/package/socket.io-client.md) ^2.3.0

## Recent versions

- 1.0.4 (latest) — 2020-04-21
- 1.0.3 — 2020-04-18
- 1.0.2 — 2020-04-18
- 1.0.1 — 2020-04-18
- 1.0.0 — 2020-04-18

## README

# laravel-echo-redux

## Getting Started

### Installing

```
npm i laravel-echo-redux
```

### Import

```
import EchoRedux from 'laravel-echo-redux';
```

## Usage

### Initialization

Create a config object and assign it with an argument to the init() method;

```
const config = {
    store, //Redux store (required)
    debug: true, //Debug mode on/off (optional)
    host: process.env.MIX_APP_URL + ':6001',
    encrypted: true,
}

EchoRedux.init(config)
```

### Subscribe channel

#### Public channel

```
//EchoRedux.subscribe(channelName,eventName,actionType);
EchoRedux.subscribe('TestChannel','TestEvent','SOCKET_TEST_EVENT_DATA');
```

or

```
//EchoRedux.subscribe(channelName,eventName,actionType);
EchoRedux.subscribe('TestChannel',['TestEvent','TestEvent2'],['ACTION_TEST_EVENT_DATA', 'ACTION_TEST_EVENT2_DATA']);
```

#### Private channel

```
//EchoRedux.subscribePrivate(channelName,eventName,actionType);
EchoRedux.subscribePrivate('TestChannel','TestEvent','ACTION_TEST_EVENT_DATA');
```

or

```
//EchoRedux.subscribePrivate(channelName,eventName,actionType);
EchoRedux.subscribePrivate('TestChannel',['TestEvent','TestEvent2'],['ACTION_TEST_EVENT_DATA', 'ACTION_TEST_EVENT2_DATA']);
```

### Leave channel

```
//EchoRedux.leaveChannel(channel,actionType);
EchoRedux.leaveChannel('TestChannel','ACTION_LEAVE_CHANNEL');
```

### Other

```
EchoRedux.unsubscribeEvent(channelName,eventName,actionType);
```

```
EchoRedux.getChannel(channelName);
```

```
EchoReux.getAllChannels();
```

```
EchoRedux.getEvents(channelName);
```

---
_Source: https://npm.io/package/laravel-echo-redux · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
