Skip to content
Logux base components to build web client
JavaScript HTML
Branch: master
Clone or download
Latest commit 8757b8f Feb 10, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows Deploy website on release Dec 8, 2019
badge
test Disable cross-tab communication on localStorage error Feb 3, 2020
.editorconfig Initial commit Jul 31, 2018
.gitignore
.npmignore
.travis.yml Update project best practices Apr 25, 2019
CHANGELOG.md
LICENSE Initial commit Jul 31, 2018
README.md
attention.js
badge.js
client.js
confirm.js
cross-tab-client.js Disable cross-tab communication on localStorage error Feb 3, 2020
favicon.js Fix type name in JSDoc Nov 17, 2019
index.js Use memory store by default Nov 29, 2018
indexed-store.js
log.js
package.json Release 0.6 version Feb 10, 2020
status.js Fix type name in JSDoc Nov 17, 2019
yarn.lock Update dependencies Feb 10, 2020

README.md

Logux Client Cult Of Martians

Logux is a new way to connect client and server. Instead of sending HTTP requests (e.g., AJAX and GraphQL) it synchronizes log of operations between client, server, and other clients.

Documentation: logux.io

This repository contains Logux base components to build web client:

  • CrossTabClient and Client to create web client for Logux.
  • IndexedStore to store Logux log in IndexedDB.
  • badge() widget to show Logux synchronization status in UI.
  • status() to write own UI to show Logux synchronization status in UI.
  • attention(), confirm(), favicon() to improve UX in Logux web app.
  • log() to print Logux synchronization status to browser DevTools.

Check demo page for widget UI.

Sponsored by Evil Martians

Install

npm install @logux/client

Usage

See documentation for Logux API.

import CrossTabClient from '@logux/client/cross-tab-client'
import messages from '@logux/client/badge/en'
import styles from '@logux/client/badge/default'
import badge from '@logux/client/badge'
import log from '@logux/client/log'

let userId = document.querySelector('meta[name=user]').content
let userToken = document.querySelector('meta[name=token]').content

const client = new CrossTabClient({
  credentials: userToken,
  subprotocol: '1.0.0',
  server: 'wss://example.com:1337',
  userId: userToken
})

badge(client, { messages, styles })
log(client)

client.start()
You can’t perform that action at this time.