logux / client

Logux base components to build web client
https://logux.org/
MIT License
663 stars 47 forks source link

Logux Client Cult Of Martians

<img align="right" width="95" height="148" title="Logux logotype" src="https://logux.org/branding/logotype.svg">

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:

Check demo page for widget UI.


Made at Evil Martians, product consulting for developer tools.


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()