Skip to content

paneer-tikka/react_actioncable_counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This is a sample app that uses react_on_rails to create a simple real-time counter. The react component subscribes to messages brodcast on an ActionCable channel and updates the count on screen in real-time.

   bundle install
   npm install
   foreman start -f Procfile.dev
  • Open localhost:3000/hello_world in multiple browser windows.
  • On a shell promp, run:
  curl localhost:3000/incr?stat=oranges

or

  curl localhost:3000/incr?stat=apples

or

  curl localhost:3000/decr?stat=oranges

or

  curl localhost:3000/decr?stat=apples
  • Watch the count of apples and oranges change.

  • Code Changes: Check the relevant commits

Note:

This is just a sample of how you can connect a actioncable broadcast to a react_on_rails component. This is not production ready. Especially note that the actioncable does not use any kind of authentication.

About

react_on_rails + actioncable

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors