JSPM

@miroiu/use-debug-panel

1.2.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q48981F
  • License MIT

useDebugPanel provides a panel where you can modify properties of an object

Package Exports

  • @miroiu/use-debug-panel

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@miroiu/use-debug-panel) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

use-debug-panel

useDebugPanel provides a panel where you can modify properties of an object

NPM

Example

Install

npm install @miroiu/use-debug-panel

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import {
    DebugPanelProvider,
    makeSlider,
    makeColor,
    useDebugPanel,
} from '@miroiu/use-debug-panel';

const App: React.FC = () => {
    const { string, slider } = useDebugPanel(
        {
            number: 1,
            string: 'text',
            boolean: true,
            date: new Date(),
            slider: makeSlider(10),
            color: makeColor('#00aaff'),
            function: () => alert('Hi'),
            array: [1, 2, 4, 5],
            object: {},
            undefined: undefined,
            null: null,
        },
        'Optional Title'
    );

    return (
        <div>
            {string}: {slider.value}
        </div>
    );
};

ReactDOM.render(
    <DebugPanelProvider>
        <App />
    </DebugPanelProvider>,
    document.getElementById('root')
);

License

MIT © miroiu