Skip to content

Prepare official support for multiple hyperscript implementations #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Document factory functions
  • Loading branch information
brechtcs committed Oct 4, 2018
commit aa2f0d00a11fe4fd55ae4e384136665a2fe6fdff
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ var { p } = require('hyperaxe')
p('this is convenient')
```

### `hyperaxe.createFactory(h)`

Creates a `hyperaxe` element factory for a given hyperscript implementation (`h`). Check `test/impl.js` to see which implementations are currently supported.

If you use another implementation than `hyperscript` proper, you can save a dependency by using `require('hyperaxe/factory')`.

### `hyperaxe.getFactory(h)`

Same as `createFactory`, except it only creates a new factory on the first call and returns a cached version after that.

## Enchantments

- Summons DOM nodes.
Expand Down