パッケージ、リポジトリ、アプリカテゴリを検索

GitHub リポジトリnamiwang/actioncable_dart

actioncable_dart

純粋な Dart または Flutter プロジェクト用の Dart における ActionCable クライアント

actioncable_dart のプロジェクト画像
スター
26
フォーク
30
最終プッシュ(UTC)
2024/10/25
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

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!

Nami W GitHub avatar
GitHub 作者

Nami W ↗

@MoonshotAI , ex-@Microsoft. AI Infra, indie games, compilers, with ruby, typescript, and rust.

@MoonshotAI
言語Dart

カテゴリー

このリポジトリが公開するパッケージ

使用している依存関係

依存関係一覧 2 件

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗