Skip to content

jto/procrastination.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

procrastination.js

What is it?

procrastination.js makes it easy to create realtime web applications using pure Javascript, by replacing the old callback paradigm, by a stream of events called a Reactive. You're not working on discrete events anymore, but with a continuous, possibly infinite, list of incoming data of any kind. Reactives have the traditionnal list methods that you are used to, like filter and map, are immutable, and reusable.

Reactive

Creating a Reactive

Let's say you want to react on keyboard events. What you first need to do, is to create a function that is your Events source:

function key(next){ $(document.body).keydown(next) }

next is a the function that should be called when an new event is raised.

Then you need to create a new Reactive, Reactive.on(key)

A Reactive won't do anything until call 'subscribe' on it.

Reactive.on(key) .subscribe()

We now have created our very first reactive :) This one does not do anything, we'll now take a look at Actions.

Action

Let's start with our first reactive: Reactive.on(key) .subscribe()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •