phoenix-to-redux
  • Overview
  • Installation
  • Quick Start
  • Reference
    • API Reference
      • Socket
        • Methods
          • disconnectPhoenix
          • connectPhoenix
        • Events
          • SOCKET_ERROR
          • SOCKET_OPEN
          • SOCKET_DISCONNECT
          • SOCKET_CLOSE
          • SOCKET_CONNECT
      • Channel
        • Methods
          • leavePhoenixChannel
          • leavePhoenixChannelEvents
          • leavePhoenixChannelEvent
          • getPhoenixChannel
          • pushPhoenixChannel
        • Events
          • CHANNEL_ERROR
          • CHANNEL_LEAVE
          • CHANNEL_JOIN_ERROR
          • CHANNEL_JOIN
          • CHANNEL_TIMEOUT
          • CHANNEL_PUSH_ERROR
          • CHANNEL_CLOSE
Powered by GitBook

Copyright (c) 2020 Trixta Inc

On this page

Was this helpful?

Export as PDF
  1. Reference
  2. API Reference
  3. Channel
  4. Methods

pushPhoenixChannel

This method will attempt to find the subscribed phoenix channel for the given channelTopic and push data to the channel for the eventName.

PreviousgetPhoenixChannelNextEvents

Last updated 2 years ago

Was this helpful?

import { pushPhoenixChannel } from '@trixtateam/phoenix-to-redux';

Recommended that you already have made a socket connection by using method before using this method.

Parameters

Parameter
Description
Type
Required

channelTopic

Name of channel/Topic

string

eventName

Name of the event on channel to push to

string

requestData

Payload data to push on the channel

any

additionalData

This data will be available for you as additionalData on the response

object

loadingStatusKey

A unique identifier you can use to separate progress status

string

endProgressDelay

timeout in milliseconds if you want to delay the endProgress of your loadingStatusKey

number

channelResponseEvent

name of redux event to dispatch to reducer on response from pushing to channel

string

channelErrorResponseEvent

name of redux event to dispatch to reducer on error from pushing to channel

string

channelTimeOutEvent

name of redux event to dispatch to reducer on timeout from pushing to channel

string

dispatchChannelError

false by default, determines if should an on channel error occur dispatch to the reducer

boolean

channelPushTimeOut

timeout in milliseconds for pushing to the channel, default is 1500

number

connectPhoenix
PHOENIX_CHANNEL_ERROR