Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unhappychoice/cycle-pusher
:recycle: Cycle.js driver for Pusher
https://github.com/unhappychoice/cycle-pusher
cyclejs library pusher typescript websocket wrapper
Last synced: 3 months ago
JSON representation
:recycle: Cycle.js driver for Pusher
- Host: GitHub
- URL: https://github.com/unhappychoice/cycle-pusher
- Owner: unhappychoice
- License: mit
- Created: 2017-10-24T12:14:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-09T08:05:50.000Z (4 months ago)
- Last Synced: 2024-10-11T13:37:13.056Z (4 months ago)
- Topics: cyclejs, library, pusher, typescript, websocket, wrapper
- Language: TypeScript
- Homepage:
- Size: 1.08 MB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# cycle-pusher
[](https://badge.fury.io/js/cycle-pusher)
[](https://libraries.io/github/unhappychoice/cycle-pusher)


cycle-pusher is pusher client for [cycle.js](https://cycle.js.org/)
### Types
```typescript
const makePusherDirver = (app_key: string, configuration: Config): Driver, PusherSource>interface PusherSource {
select(channelName: string, eventName: string): Stream;
}interface PayloadOutput {
channelName: string;
eventName: string;
data: any;
}interface PayloadInput {
channelName: string;
eventName: string;
data: any;
}
```### Usage
```typescript
function main(sources) {
const content$ = sources.pusher.select("channel1", "event1") // Receive messagesconst payload$ = Stream.of({ // Send messages
channelName: "channel1",
eventName: "client-event1",
data: { "key": "value" }
});return {
pusher: payload$
};
}const app_key = "";
const config = { // See pusher document
encrypted: true
};run(main, {
pusher: makePusherDirver(app_key, config)
});```
see example directory for real usage.
### License
see [LICENSE](./LICENSE)