Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

react-maybe-state

1.0.0 • Public • Published

React Maybe State

Kind of like the Maybe monad but for state values. No more (this.state.foo ? (this.state.foo.bar ? f(this.state.foo.bar) : null) : null) boilerplate.

Example
render() {
  return <div>My name this {this.maybeState('identity', 'firstName')} {this.maybeState('identity', 'lastName')}.</div>;
}

Keywords

none

install

npm i react-maybe-state

Downloadsweekly downloads

1

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar