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>;
}

/react-maybe-state/

    Package Sidebar

    Install

    npm i react-maybe-state

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • elie.rotenberg