Sha256: 601e41b3a20caf40137a9c4b2816e8fd98bc39de2439ca3e4f64e386e13572ce

Contents?: true

Size: 644 Bytes

Versions: 2

Compression:

Stored size: 644 Bytes

Contents

import { Deps, Env, Loco } from "loco-js";
import { createConsumer } from "@rails/actioncable";
import NotificationCenter from "services/NotificationCenter";
import Connectivity from "services/Connectivity";

Deps.cable = createConsumer();
Deps.NotificationCenter = NotificationCenter;

const connectivity = new Connectivity();

const loco = new Loco({
  notifications: {
    enable: true,
    log: true,
    size: 10
  },
  postInit: () => {
    connectivity.call();

    if (
      document.querySelector("body").getAttribute("data-rails-env") !== "test"
    )
      return;
    Env.loco.getWire().setPollingTime(1000);
  }
});

loco.init();

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
loco-rails-3.0.5 test/dummy/frontend/js/initializers/loco.js
loco-rails-3.0.4 test/dummy/frontend/js/initializers/loco.js