Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fp-dom

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fp-dom

A collection of functions to favor functional programming in a DOM context

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

FP-DOM

npm version Dependency Status

A container module to group lots of simple functional tools. This package only re-export all of the fp-dom tools found here.

Usage

All packages are re-exported without the fd- prefix. Some packages, fd-select, fd-class exports more than one function and are also available in the root level of fp-dom.

Import all package at once

import * as fpdom from 'fp-dom';

// use any module: 

let appendtoBody = fpdom.append(document.body),
  h1 = fpdom.elem('h1','meow'),
  h2 = fpdom.elem('h2', 'bow');

appendtoBody(h1);
fpdom.replace(document.body,h2,h1);


let foo = fpdom.select(document)('.foo');  // array of .foo elements
let bar = fpdom.selectOne(document)('.bar'); // first .bar element

Import some packages

import { animate, append, listen, select, velem } from 'fp-dom';

// use them directly

let onClick = listen('click');
let onClickSetClicked = onClick((event) => {
  event.target.innerHTML = 'clicked';
});

onClickSetClicked(select('.link'));

Requires in ES5

You can still use ES5 modules to require some or all modules.

var fpdom = require('fp-dom');

var selectOne = require('fp-dom').selectOne;
var replace = require('fp-dom').replace;

Included modules

License

MIT © stoeffel hemanth

Keywords

FAQs

Package last updated on 16 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc