0.1.4 • Published 7 years ago

uvjs v0.1.4

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

UV

Small reactive library for class bindings, events and actions.

npm version

Install & import

You can use UV in many different ways. If you're not using UV as an NPM package you can find bundles (with bundled dependencies) in the dist folder of this repository.

NPM package

yarn add uvjs

# or

npm install uvjs --save
import uv from 'uvjs'

Native module

import uv from './dist/uv.module.js'

Browser global

<script src="dist/uv.browser.js"></script>

Usage

Initialize

const app = new uv({
  isRaining: false,
  hasMoon: true
})

Bind element classes to props

app.bind('.sky', {
  raining: () => app.isRaining
})

Bind events/actions to elements

app.on('.toggle', 'click', () => {
  app.isRaining = !app.isRaining
})

app.on('.sky', 'scroll', scrolled => {
  app.hasMoon = scrolled < 400
})

Watch props

app.watch('hasMoon', val =>
  console.log('Moon is now ' + val)
)
0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

1.0.0

7 years ago