Skip to content

j-deng/phoenix-miniprogram-channel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

phoenix-miniprogram-channel

It's a phoenix channels client for wechat miniprogram, forked from https://github.com/phoenixframework/phoenix/blob/v1.3/assets/js/phoenix.js

The difference from js version is that socket.connect() returns a promise, we should join channels after this promise resolved.

Usage:

yarn add phoenix-miniprogram-channel
import { Socket } from 'phoenix-miniprogram-channel'

const socket = new Socket('wss://example.com/socket')
socket.connect().then(() => {
  const channel = socket.channel('room:lobby', {})
  channel.join()
    .receive('ok', () => console.log('Joined successfully'))
})

Other api plase refer the doc for phoenix.js

About

phoenix channels client for wechat miniprogram

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published