warden.js

0.4.1 • Public • Published

Warden.js Build Status

Small declarative library for event-driven development in functional reactive style.

Concept

Warden.js provides instruments to make development of event-driven applications easy and declarative. General idea of Warden.js that to make composing, combining and resolving concurrent events simpler. In mathematical sense, idea that to change your app's events representation from tree of states to the partially ordered set in time (or other) priority relation.

Warden.js is not pure functional library. It's trade-off between pure FRP and traditional event-driven development. It's good solution for ready event-driven applications. If you don't want to think how to construct app with true functional practices from start or/and you already have partially ready app then you can try Warden to make you life easy.

Warning! Breaking changes from 0.3.*. Documentation may be deprecated for 0.4.*

Documentation GitHub version

Why Warden.js?

  • There are no dependencies with DOM, jQuery or other libraries or event emitting system in the Warden.js. You can use it on the front and on the back. With jQuery or with Node's Event Emiter or without anything. It's flexible.
  • Simple declarative methods to combine, conjuncte and resolve concpetually connected events. Like sync or resolve. If your application turns to tangled web of simple events and you spoiling time to resolve synchronization, combining events in time and resolving problems - then Warden.js is for you.
  • Pretty flexible API. There are no much of ready solutions, but there is way to add your own data stream processing method, combine methods and construct application in your way.
  • It's not pure functional, but stay simple. In Warden you can create modules with dirty state, but if you're sure that these modules are simple and state is predictable. So after you can combine and reuse modules in more declarative way. It's not required to use pure functional programming technics from start to end while develop with Warden.
  • It's lighweight. Current version (0.4.0): 15 KB (6 KB gzipped). And it comes with crossbrowser utilities package.
  • It's configurable. You can extend stream processing methods, create your own methods, configure data types and comparsion checking.
  • Low-level functional abstraction. You can write a bunch of cool things. An events sampler (for example).

Why not Warden.js?

  • Too early to use it in really large and demandig applications. Currently library is pretty raw. No community, no experience. If you are orienting to the secure, high performance, popular library or framework don't use Warden.js. But you can help us make it better!
  • Weaky realization of F from FRP. If you are looking at ready solutions for pure functional in reactive way - check out Bacon, kefir, ProAct
  • Low performance. In optimal usage it's faset than Bacon.js, but if you want to stay pure functional you could find that Warden is much more slower than Kefir, RxJS (sometimes it's a bit of slower than Bacon.js).
  • Low-level functional abstraction. You should write a bunch of code to develop an events sampler (for example).

Installation and usage

Node npm version

npm install warden.js

and

var Warden = require('warden.js');

Browser

bower install warden.js

and

<script src="path/to/warden.js"></script>

Contribute

We're always glad to new pull requests or issues. Feel free to make contributions.

Package Sidebar

Install

npm i warden.js

Weekly Downloads

0

Version

0.4.1

License

MIT

Last publish

Collaborators

  • zefirka