►
From YouTube: An ActionCable based WebSocket Provider for Y.js
Description
Y.js comes with support for WebSockets and the Broadcast Channel API (https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API). Until now, we couldn't use that, but this npm package bridges the gap between Rails ActionCable and Y.js.
A
A
A
A
One
second,
here's
our
editor,
so
we
have
a
ygs
document.
We
initialize
our
new
provider.
This
is
all
we
need.
The
graphql
are
the
action
cable
channel
that
we
use
an
arbitrary
number
of
parameters
that
are
just
forwarded
to
that
action:
cable
channel,
the
already
existing
action,
cable,
consumer
and
yeah-
that's
pretty
much
it.
This
is
just
tips,
tip
tip
basic
tip,
tip
configuration,
and
we
just
put
the
provider
here
and
that's
pretty
much
it.
So
this
allows
us
to
use
ygs
with
the
tips
of
editors
within
our
rails.