2.0.0-beta.8 • Published 2 years ago

hyperapp-debug v2.0.0-beta.8

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

Hyperapp Debug

Travis CI npm Discord

A debugger for your Hyperapp applications.

What is it

hyperapp-debug is a debugger for your hyperapp development flow. It gives you insight into state transitions, when effects are fired, or if you have stubborn subscriptions.

Hyperapp V1

If you are debugging Hyperapp V1 applications, check out the legacy debugger.

Installation

Install with npm or Yarn.

Then with a module bundler like Rollup or Webpack, use as you would anything else.

import { app, h } from 'hyperapp';
import { debuggable } from 'hyperapp-debug';

Or with <script type="module"> and unpkg:

import { app, h } from 'https://unpkg.com/hyperapp?module=1';
import { debuggable } from 'https://unpkg.com/hyperapp-debug?module=1';

If you don't want to set up a build environment, you can download Hyperapp Debug from a CDN like unpkg.com, and it will be globally available through the window'hyperapp-debug'.default object. hyperapp-debug supports all ES5-compliant browsers, including Internet Explorer 10 and above.

<head>
  <script src="https://unpkg.com/hyperapp"></script>
  <script src="https://unpkg.com/hyperapp-debug"></script>
</head>
<body>
  <script>
    const { app, h } = window.hyperapp;
    const { debuggable } = window['hyperapp-debug'];
    // Your code here...
  </script>
</body>

Usage

Use debuggable to wrap Hyperapp's app function.

import { app } from 'hyperapp';
import { debuggable, adapters } from 'hyperapp-debug';

debuggable(app)({
  init: {},
  view: () => null,
  subscriptions: () => [],
  node: document.getElementById('your-app'),
  debug: {
    enable: true,
    adapter: adapters.ConsoleAdapter.use,
    id: 'your-custom-id',
  },
});

Adapters

Check out the Adapters documentation.

History

For those coming from the elm community, you may notice much inspiration from Elm's time-travelling debugger :heart:.

Contributing

Check out the CONTRIBUTING.md guidelines for more information.

License

Hyperapp Debug is MIT licensed. See LICENSE.md.

Other similar tools

2.0.0-beta.8

2 years ago

2.0.0-beta.7

2 years ago

2.0.0-beta.2

3 years ago

2.0.0-beta.1

3 years ago

2.0.0-beta.0

3 years ago

2.0.0-beta.6

2 years ago

2.0.0-beta.5

3 years ago

2.0.0-beta.4

3 years ago

2.0.0-beta.3

3 years ago

1.0.0-beta.5

4 years ago

1.0.0-beta.4

5 years ago

1.0.0-beta.3

5 years ago

1.0.0-beta.2

5 years ago

1.0.0-beta.1

5 years ago

1.0.0-beta.0

5 years ago

0.0.1-beta.12

5 years ago

0.0.1-beta.11

5 years ago

0.0.1-beta.10

6 years ago

0.0.1-beta.9

6 years ago

0.0.1-beta.8

6 years ago

0.0.1-beta.7

6 years ago

0.0.1-beta.6

6 years ago

0.0.1-beta.5

6 years ago

0.0.1-beta.4

6 years ago

0.0.1-beta.3

6 years ago

0.0.1-beta.2

6 years ago

0.0.1-beta.1

6 years ago

0.0.1-beta.0

6 years ago