Skip to content

logux/client

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
November 8, 2022 22:17
October 19, 2021 12:36
October 19, 2021 12:36
July 30, 2022 13:23
October 19, 2021 12:36
October 20, 2021 01:27
September 21, 2021 03:13
April 28, 2021 18:10
log
July 30, 2022 13:15
October 22, 2021 01:12
April 21, 2022 19:47
October 19, 2021 12:36
November 17, 2022 13:35
October 19, 2021 12:36
September 21, 2021 03:13
vue
December 26, 2021 00:54
July 30, 2018 23:36
January 10, 2022 07:50
November 17, 2022 13:33
July 30, 2018 23:36
April 6, 2022 21:27
April 6, 2022 21:27
November 17, 2022 13:33
November 17, 2022 13:31

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.

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/core @logux/client nanostores

Usage

See documentation for Logux API.

import { CrossTabClient, badge, badgeEn, log } from '@logux/client'
import { badgeStyles } from '@logux/client/badge/styles'

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

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

badge(client, { messages: badgeEn, styles: badgeStyles })
log(client)

client.start()