1.0.3 • Published 2 years ago

solid-use-lanyard v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

solid-use-lanyard

Minified Size Dependency Count CI

This project is highly inspired by @barbarbar338's react-use-lanyard

⚠️ This module doesn't support REST since it's very easy to use in any environment, but pr welcome!

Use Lanyard with WebSocket on your SolidJS app easily!

Install

pnpm/yarn add solid-use-lanyard
# or
npm install solid-use-lanyard

Usage

import type { Component } from 'solid-js';
import { useLanyard } from '../../dist/';

const App: Component = () => {
  const { status /*, loading */ } = useLanyard({
    userId: '919696170606030848',
  });

  return (
    <div>
      <h1>
        Username: {status()?.discord_user.username}#
        {status()?.discord_user.discriminator}
      </h1>
      <h1>Avatar: {status()?.discord_user.avatar}</h1>
      <h1>JSON Data:</h1>
      <pre>
        <code>{JSON.stringify(status(), null, 2)}</code>
      </pre>
    </div>
  );
};

export default App;

License

Distributed under the GPL-3.0 License. See LICENSE for more information.

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.2.0

2 years ago

1.0.3

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago