From 071f3c962cc114719666d8ea0a500913f0ac79bc Mon Sep 17 00:00:00 2001 From: Geoff Doty Date: Wed, 22 May 2024 12:34:59 -0400 Subject: [PATCH] doc tweaks --- README.md | 10 ++++++---- src/app.js | 7 ++++--- src/tag.js | 6 +++--- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a206509..cbf9c27 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Um, is an experimental composable UI builder that takes ideas from early [hyperapp](https://github.com/jorgebucaran/hyperapp) design, but does not stick to strict Elm Architecture. -Um, because you should think about NOT using it. +Um, because you should think about, um, NOT using it. ## Features - No Virtual Dom @@ -15,7 +15,7 @@ Um, because you should think about NOT using it. ## Overview -The library only has 2 functions, `app()` and `h()`, and the later is optional. +**Um** only has 2 exported functions, `app()` and `h()`, and the later is optional. ### app({opts}) @@ -28,17 +28,19 @@ The `app()` is the builder function and takes an `opts` object: | `state` | `{}` | initial data state | | `actions` | `{}` | function object passed to view | | `view` | `(state, actions) => null` | function that takes state and actions and returns valid dom | -| `mount` | "body" | valid query selector as mounting point | +| `mount` | `body` | valid query selector as mounting point | #### Output: +> WARNING: May change in future + | Property | Description | | --------------- | --------------------------------------------- | | `state([data])` | state function to get or update internal data | ### h(tag, [...args]) -The `h()` is an **optional** hypertext build utility that weighs in around **~250b** and is provided as *a* way to build out your view markdown, but you can build your view using any method you like as long as it returns valid dom. +The `h()` is an **optional** hypertext build utility that weighs in around **~250b** and is provided as *a* way to build out your `view` DOM, but you can build your `view` using any method you like as long as it returns valid DOM. ## Example diff --git a/src/app.js b/src/app.js index a669d5e..f588df3 100644 --- a/src/app.js +++ b/src/app.js @@ -1,15 +1,16 @@ /** * App Builder * - * Composes data, views, actions together as + * Composes state, actions, view together as * mountable ui * - * @param {Object} opts options + * @param {Object} opts options bag of state, view, actions, and mount * @param {Object} opts.state initial app object state * @param {Function} opts.view function that returns dom. state and actions are passed in * @param {Object} opts.actions object functions includes and return state * @param {String} opts.mount querySelector value - * @returns + * + * @returns {Object} state proxy object */ export default function app(opts) { // initial setup diff --git a/src/tag.js b/src/tag.js index 4dfa215..e546c4c 100644 --- a/src/tag.js +++ b/src/tag.js @@ -1,10 +1,10 @@ /** * HTML Tag Scripting Function * - * creates new DOM element(s) from tag name(s) and attributes + * Generates new DOM element(s) from a tag, attributes * - * @param {String} tag - tag to create - * @param {*} args - attributes and/or child tag elements + * @param {string} tag - tag name + * @param {any} args - attributes, text or array of child elements * * @returns {HTMLElement} The created DOM element(s) */