action_cable
डार्ट में एक्शन केबल क्लाइंट, वेब, डार्टवीएम और फ्लटर में उपलब्ध।
डार्ट में एक्शनकेबल क्लाइंट, शुद्ध डार्ट या फ्लटर प्रोजेक्ट के लिए
यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
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.
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");
});
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
);
cable.unsubscribe(
"Chat", // either "Chat" and "ChatChannel" is fine
{"room": "private"}
);
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! 😜" }
);
cable.disconnect();
Anycable has a great doc on that topic.
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!
निर्भरता सूची 2 आइटम
^3.0.1—उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗