Skip to content

Commit

Permalink
Merge branch 'docs' into 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jojibucaran committed Apr 29, 2017
2 parents 83e80a6 + 8410d9d commit 5971b3c
Show file tree
Hide file tree
Showing 22 changed files with 1,397 additions and 31 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2017 Jorge Bucaran
Copyright © 2017 [Jorge Bucaran](https://github.com/jbucaran)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ HyperApp is a JavaScript library for building frontend applications.
[CDN]: https://unpkg.com/hyperapp

* **Declarative**: HyperApp's design is based on the [Elm Architecture]. Create scalable browser-based applications using a functional paradigm. The twist is you don't have to learn a new language.
* **Stateless components**: Build complex user interfaces from micro-components. Stateless components are framework agnostic, reusable and easier to debug.
* **Custom tags**: Build complex user interfaces from custom tags. Custom tags are stateless, framework agnostic and easy to debug.
* **Batteries-included**: Out of the box, HyperApp has Elm-like state management and a virtual DOM engine; it still weighs `1kb` and has no dependencies.

[Get started with HyperApp](https://github.com/hyperapp/hyperapp/wiki/Getting-Started).
[Get started with HyperApp](/docs/getting-started.md)

## Hello World

[CodePen](https://codepen.io/jbucaran/pen/Qdwpxy) · [Examples](https://hyperapp.glitch.me)

```jsx
app({
state: "Hello World",
state: "Hi.",
view: state => <h1>{state}</h1>
})
```
Expand All @@ -35,7 +35,7 @@ No software is free of bugs. If you're not sure if something is a bug or not, [f

## Documentation

See the [Wiki](https://github.com/hyperapp/hyperapp/wiki).
The documentation is located in the [/docs](/docs) directory.

## Community

Expand All @@ -46,3 +46,4 @@ See the [Wiki](https://github.com/hyperapp/hyperapp/wiki).
## License

HyperApp is MIT licensed. See [LICENSE](LICENSE.md).

48 changes: 48 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Documentation

* [Getting Started](/docs/getting-started.md)
* [Hyperx](/docs/hyperx.md)
* [JSX](/docs/jsx.md)
* [Virtual Nodes](/docs/virtual-nodes.md)
* [Custom Tags](/docs/custom-tags.md)
* [Applications](/docs/applications.md)
* [View and State](/docs/applications.md#view-and-state)
* [Actions](/docs/applications.md#actions)
* [Namespaces](/docs/applications.md#namespaces)
* [Events](/docs/applications.md#events)
* [Custom Events](/docs/applications.md#custom-events)
* [Plugins](/docs/applications.md#plugins)
* [Lifecycle Events](/docs/lifecycle-events.md)
* [oncreate](/docs/lifecycle-events.md#oncreate)
* [onupdate](/docs/lifecycle-events.md#onupdate)
* [onremove](/docs/lifecycle-events.md#onremove)
* [Router](/docs/router.md)
* [actions](/docs/router.md#actions)
* [go](/docs/router.md#actions-go)
* [state](/docs/router.md#state)
* [params](/docs/router.md#state-params)
* [match](/docs/router.md#state-match)
* [events](/docs/router.md#events)
* [route](/docs/router.md#events-route)
* [Tutorials](/docs/tutorials.md)
* [Counter](/docs/counter.md)
* [Countdown Timer](/docs/countdown-timer.md)
* [Gif Search](/docs/gif-search.md)
* [API](/docs/api.md)
* [h](/docs/api.md#h)
* [app](/docs/api.md#app)
* [state](/docs/api.md#state)
* [view](/docs/api.md#view)
* [actions](/docs/api.md#actions)
* [[_namespace._]action](/docs/api.md#actions-action)
* [events](/docs/api.md#events)
* [loaded](/docs/api.md#events-loaded)
* [action](/docs/api.md#events-action)
* [update](/docs/api.md#events-update)
* [render](/docs/api.md#events-render)
* [plugins](/docs/api.md#plugins)
* [Plugin](/docs/api.md#plugins-plugin)
* [root](/docs/api.md#root)
* [emit](/docs/api.md#emit)


122 changes: 122 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# API

* [h](#h)
* [app](#app)
* [state](#state)
* [view](#view)
* [actions](#actions)
* [[_namespace._]action](#actions-action)
* [events](#events)
* [loaded](#events-loaded)
* [action](#events-action)
* [update](#events-update)
* [render](#events-render)
* [plugins](#plugins)
* [Plugin](#plugins-plugin)
* [root](#root)
* [emit](#emit)

## <a name="h"></a> h

Type: <samp>([tag](#h-tag), [data](#h-data), [children](#h-children)): [vnode](#vnode)</samp>

* <a name="h-tag"></a>**tag**: <samp>string | ([props](#h-data), [children](#h-children)): [vnode](#vnode)</samp>
* <a name="h-data"></a>**data**: <samp>object</samp> with [attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes), [styles](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference), [events](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers), [lifecycle events](/docs/lifecycle-events.md).
* <a name="h-children"></a>**children**: <samp>string | Array\<[vnode](#vnode)\>
* <a name="vnode"></a>**vnode**: a [virtual node](/docs/virtual-nodes.md).

## <a name="app"></a> app

Type: <samp>([props](#app-props))</samp>

* <a name="app-props"></a> **props**
* [state](#state)
* [view](#view)
* [actions](#actions)
* [events](#events)
* [plugins](#plugins)
* [root](#root)

<a name="app-props"></a>

### <a name="state"></a> state

Type: <samp>Any</samp>

### <a name="view"></a> view

Type: <samp>([state](#state), [actions](#actions)): [vnode](#vnode)</samp>

### <a name="actions"></a> actions
#### <a name="actions-action"></a> [_namespace._]action

Type: <samp>([state](#state), [actions](#actions), [data](#actions-data), [emit](#emit))</samp>

* <a name="actions-data"></a> **data**: the data passed to the action.

```jsx
actions: {
foo: {
bar: (state, actions, data, emit) => {}
}
}

actions.foo.bar(data)
```

### <a name="events"></a> events
#### <a name="events-loaded"></a> loaded

Type: <samp>([state](#state), [actions](#actions), _, [emit](#emit)) | Array\<[Type](#events-loaded)\></samp>

Fired after the view is mounted on the DOM.

#### <a name="events-action"></a> action

Type: <samp>([state](#state), [actions](#actions), [data](#events-action-data), [emit](#emit)): [data](#events-action-data) | Array\<[Type](#events-action)\></samp>

* <a name="events-action-data"></a>**data**
* **name**: the name of the action.
* **data**: the data passed to the action.

Fired before an action is triggered.

#### <a name="events-update"></a> update

Type: <samp>([state](#state), [actions](#actions), [data](#events-update-data), [emit](#emit)): [data](#events-update-data) | Array\<[Type](#events-update)\></samp>

* <a name="events-update-data"></a>**data**: the updated fragment of the state.

Fired before the state is updated.

#### <a name="events-render"></a> render

Type: <samp>([state](#state), [actions](#actions), [data](#events-render-data), [emit](#emit)): [data](#events-render-data) | Array\<[Type](#events-render)\></samp>

* <a name="events-render-data"></a>**data**: the [view](#view) function.

Fired before the view is rendered.

### <a name="plugins"></a> plugins

Type: <samp>Array\<[Plugin](#plugins-plugin)\></samp>

#### <a name="plugins-plugin"></a> Plugin

Type: <samp>([props](#app-props)): [props](#plugin-props)</samp>

* <a name="plugin-props"></a> **props**
* [state](#state)
* [actions](#actions)
* [events](#events)

### <a name="root"></a> root

Type: <samp>[Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) = [document.body](https://developer.mozilla.org/en-US/docs/Web/API/Document/body)</samp>

## <a name="emit"></a> emit

Type: <samp>([event](#emit-event), [data](#emit-data)): [data](#emit-data)</samp>

* <a name="emit-event"></a> **event**: the name of the event.
* <a name="emit-data"></a> **data**: the data passed to the event.
Loading

0 comments on commit 5971b3c

Please sign in to comment.