pointfree-jquery
v1.9.15
Published
Curried a few common jQuery methods to allow them to be written in a point free fashion.
Readme
pointfree-jquery
Curried a few common jQuery methods to allow them to be written in a point free fashion.
npm install --save pointfree-jquery
import { compose, map, hide, show } from 'pointfree-jquery';
import $ from 'jquery';
import IO from 'fantasy-io';
const blink = map(compose(
show('slow'),
hide('fast')
));
const program = compose(
blink,
IO
);
program(_ => $('body')).unsafePerform();
All methods receive their data as the last argument.
import { addClass, css, on, compose, map } from 'pointfree-jquery';
import $ from 'jquery';
import IO from 'fantasy-io';
const logInfo = function(e) {
console.log(this, e);
};
const handler = compose(
on('click', logInfo),
css({ 'background': 'green' }),
addClass('example')
);
const program = compose(
map(handler),
IO
);
program(_ => $('body')).unsafePerform();
EFFECTS
addClasscssfadeInfadeOutfadeTofadeTogglehideremoveclassshowslideToggleslideUptoggle
HANDLERS
bindblurchangeclickcontextmenudblclickdiefocusfocusoutkeydownkeypresskeyupliveloadmousedownmouseentermouseleavemousemovemouseuponresizescrollselectsubmitunbindunload
UTILS
composecurrymaptrace
