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

deku-prop-types-immutable

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deku-prop-types-immutable

Immutable prop type validation for Deku components

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

deku-prop-types-immutable

NPM version Build Status Coverage Status

Code Climate Dependencies DevDependencies

Immutable prop type validation for Deku components

Install

npm install --save deku-prop-types-immutable

Usage

Note: These Prop Type Validators are meant to be used alongside deku-prop-types

function-component.jsx

import {element} from 'deku'
import ImmutablePropTypes from 'deku-prop-types-immutable'
import {PropTypes, validate} from 'deku-prop-types'

const Counter = ({props}) => <div>{props.count}</div>
Count.propTypes = {
  count: PropTypes.number.isRequired,
  config: ImmutablePropTypes.map
}

export default validate(Counter)

object-component.jsx

import {element} from 'deku'
import ImmutablePropTypes from 'deku-prop-types-immutable'
import {PropTypes, validate} from 'deku-prop-types'

const Counter = {
  propTypes: {
    count: PropTypes.number.isRequired,
    config: ImmutablePropTypes.map
  },
  render({props}) {
    return <div>{props.count}</div>
  }
}

export default validate(Counter)

Supported types

ImmutablePropTypes.iterable

Validate prop is an Immutable.Iterable

ImmutablePropTypes.iterableOf

Validate each property's value is of a certain type

ImmutablePropTypes.list

Validate prop is an Immutable.List

ImmutablePropTypes.listOf

Validate each value is of a certain type

ImmutablePropTypes.map

Validate prop is an Immutable.Map

ImmutablePropTypes.mapOf

Validate each property's value is of a certain type

ImmutablePropTypes.orderedMap

Validate prop is an Immutable.OrderedMap

ImmutablePropTypes.orderedMapOf

Validate each property's value is of a certain type

ImmutablePropTypes.orderedSet

Validate prop is an Immutable.OrderedSet

ImmutablePropTypes.orderedSetOf

Validate each value is of a certain type

ImmutablePropTypes.record

Validate prop is an Immutable.Record

ImmutablePropTypes.set

Validate prop is an Immutable.Set

ImmutablePropTypes.setOf

Validate each value is of a certain type

ImmutablePropTypes.seq

Validate prop is an Immutable.Seq

ImmutablePropTypes.seqOf

Validate each value is of a certain type

ImmutablePropTypes.shape

Validate a property's value matches the specified type. This works with Iterable, Map, and OrderedMap.

ImmutablePropTypes.stack

Validate prop is an Immutable.Stack

ImmutablePropTypes.stackOf

Validate each value is of a certain type

License

MIT © Dustin Specker

Keywords

FAQs

Package last updated on 31 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