abstract class LiveView

Defined in:

live_view.cr

Constant Summary

CHANNELS = Hash(String, Channel).new
GC_INTERVAL = 30.seconds
VERSION = "0.1.0"

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Constructor Detail

def self.new #

[View source]

Class Method Detail

def self.handle(socket) #

[View source]

Instance Method Detail

def __mount__(socket) #

[View source]
def __unmount__(socket) #

[View source]
def every(duration : Time::Span, &block) #

[View source]
def handle_event(event_name : String, data : String, socket : HTTP::WebSocket) #

[View source]
def live_view(io, id : Nil | String = UUID.random.to_s) #

[View source]
def live_view_id #

[View source]
def mount(socket : HTTP::WebSocket) #

I thought about making these abstract but most of the time you only need 1-2 of them, making about half of their definitions worthless.


[View source]
def mounted? : Bool #

[View source]
def to_s(io) #

[View source]
def unmount(socket : HTTP::WebSocket) #

[View source]
def update(socket : HTTP::WebSocket, buffer = IO::Memory.new) #

[View source]
def update(socket : HTTP::WebSocket, buffer = IO::Memory.new, &) #

[View source]

Macro Detail

macro javascript_tag #

[View source]
macro render(string) #

[View source]
macro template(filename) #

[View source]