All Projects → namiwang → actioncable_dart

namiwang / actioncable_dart

Licence: MIT license
actioncable client in dart, for pure dart or flutter project

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to actioncable dart

Stimulus reflex
Build reactive applications with the Rails tooling you already know and love.
Stars: ✭ 1,928 (+7612%)
Mutual labels:  actioncable
Anycable
Polyglot replacement for Ruby WebSocket servers with Action Cable protocol
Stars: ✭ 1,610 (+6340%)
Mutual labels:  actioncable
Chatwoot
Open-source customer engagement suite, an alternative to Intercom, Zendesk, Salesforce Service Cloud etc. 🔥💬
Stars: ✭ 11,554 (+46116%)
Mutual labels:  actioncable
stimulus reflex
Build reactive applications with the Rails tooling you already know and love.
Stars: ✭ 2,001 (+7904%)
Mutual labels:  actioncable
anycable-client
AnyCable / Action Cable JavaScript client for web, Node.js & React Native
Stars: ✭ 40 (+60%)
Mutual labels:  actioncable
stimulus reflex todomvc
An implementation of TodoMVC using Ruby on Rails, StimulusJS, and StimulusReflex
Stars: ✭ 50 (+100%)
Mutual labels:  actioncable
erlycable
Anycable Erlang WebSocket server
Stars: ✭ 44 (+76%)
Mutual labels:  actioncable
cubism
Lightweight Resource-Based Presence Solution with CableReady
Stars: ✭ 47 (+88%)
Mutual labels:  actioncable
action-cable-react-jwt
Rails action-cable integration with JWT authentication
Stars: ✭ 38 (+52%)
Mutual labels:  actioncable

Pub

All Contributors

ActionCable in Dart

ActionCable is the default realtime websocket framework and protocol in Rails.

This is a dart port of the client and protocol implementation which is available in web, dartVM and flutter.

Usage

Connecting to a channel 🙌

cable = ActionCable.Connect(
  "ws://10.0.2.2:3000/cable",
  headers: {
    "Authorization": "Some Token",
  },
  onConnected: (){
    print("connected");
  }, 
  onConnectionLost: () {
    print("connection lost");
  }, 
  onCannotConnect: () {
    print("cannot connect");
});

Subscribing to channel 🎉

cable.subscribe(
  "Chat", // either "Chat" and "ChatChannel" is fine
  channelParams: { "room": "private" },
  onSubscribed: (){}, // `confirm_subscription` received
  onDisconnected: (){}, // `disconnect` received
  onMessage: (Map message) {} // any other message received
);

Unsubscribing from a channel 🎃

cable.unsubscribe(
  "Chat", // either "Chat" and "ChatChannel" is fine
  {"room": "private"}
);

Perform an action on your ActionCable server 🎇

Requires that you have a method defined in your Rails Action Cable channel whose name matches the action property passed in.

cable.performAction(
  "Chat",
  action: "send_message",
  channelParams: { "room": "private" },
  actionParams: { "message": "Hello private peeps! 😜" }
);

Disconnect from the ActionCable server

cable.disconnect();

ActionCable protocol

Anycable has a great doc on that topic.

Contributors

Thanks goes to these wonderful people (emoji key):


Clinton

💻 ⚠️

Hamad AlGhanim

💻

Fareesh Vijayarangam

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].