패키지, 저장소 및 앱 카테고리 검색

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 ↗