Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Latest commit

 

History

History
29 lines (21 loc) · 1.34 KB

readme.md

File metadata and controls

29 lines (21 loc) · 1.34 KB

@hydrofoil/alcaeus-form

Automatically render forms for Hydra-driven operations

Build Status BrowserStack Status codecov

Installation

npm i --save @hydrofoil/alcaeus-forms

Usage

Here's an example showing how form is used with lit-html

import { Hydra } from 'alcaeus'
import { html } from 'lit-html'
import '@hydrofoil/alcaeus-forms/alcaeus-form'

const resource = (await Hydra.loadResource('http://hydra-movies.herokuapp.com/')).root
const collection = resource.getCollections()[0]
resource.operations.find(op => op.method === 'POST')

const form = html`<alcaeus-form .operation="${operation}"></alcaeus-form>`