Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Functional User Interaction Library #experimental #browser #component

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 sources
Octocat-spinner-32 templates
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .jshintrc
Octocat-spinner-32 Makefile
Octocat-spinner-32 README.md
Octocat-spinner-32 binder.js
Octocat-spinner-32 docs.json
Octocat-spinner-32 eventchain.js
Octocat-spinner-32 eventsource.js
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
README.md

fui

This is an experimental library to experiment whether handling of events can neatly be abstracted away from the actual event handling code itself.

NPM

experimental

Example Code

Here is some example code:

var fui = require('fui');

fui()
  .up(function(context, target, x, y) {
    this.state.down = false;
  })
  .filter('canvas')
  .relative()
  .each(function(target) {
     this.args.unshift(target.getContext('2d'));
  })
  .down(function(context, target, x, y) {
    this.state.down = true;

    context.beginPath();
    context.moveTo(x, y);
  })
  .move(function(context, target, x, y) {
    if (this.lastTarget && target !== this.lastTarget) {
      context.moveTo(x, y);
    }
    else if (this.state.down) {
      context.lineTo(x, y);
      context.stroke();
    }
  });

Reference

bind(target, evtName, callback)

EventChain(opts)

each(handler)

filter(selector)

relative()

pipe(target)

down(handler)

up(handler)

move(handler)

_next(evt)

_on(eventName, handler)

_step(stepHandler)

FuiEventSource

add(chain)

handle(eventName)

_createEvent(name, evt)

Something went wrong with that request. Please try again.