azalea

0.7.1 • Public • Published

azalea

a light-weight and pure javascript framework.

Getting started

Installation

npm install --save azalea

Examples

Core concepts

  • context
  • component
  • route

Context

  • a plain javascript object
  • application level state

Component

<progress component="progress" min="0" max="100" value="30"></progress>
  • a plain javascript function function (element, context, render) {}.
  • element is DOM Element
  • context is Context, the application level state
  • render' isFunction`, no arguments, will rerun every component again
  • element.onunload is Function?, defined it to destroy the third party plugins or something else
  • element.onupdate is Function?, defined it to call element.onupdate instead of component

Route

  • route is a plain javascript object
  • route.name is String
  • route.path is String, to match the window.location.hash
  • route.before is Function | [Function] | {Function}, accept return value is Promise, often used to prefetch data
  • route.after is Function | [Function] | {Function}, the same as route.before

Contribution

since azalea is trying to provide only the minimal essential tools to develop an web application, all pull requests with this consideration will be glad to accept.

Test

npm test

License

ISC

Readme

Keywords

none

Package Sidebar

Install

npm i azalea

Weekly Downloads

45

Version

0.7.1

License

ISC

Unpacked Size

10.5 kB

Total Files

7

Last publish

Collaborators

  • fanlia