0.0.4 • Published 7 years ago

immutable-dot v0.0.4

Weekly downloads
13
License
-
Repository
github
Last release
7 years ago

Immutable Dot

Simple helper for using dot notation with Immutable.js.

Turning

state.getIn(['path', 'to', 'value'])

into

state.getIn(dot('path.to.value')

Inspired by this issue comment.

Installation

  npm install immutable-dot

Usage

  // Import dependencies
  import Immutable from 'immutable'
  import dot from 'immutable-dot'

  // Make immutable map from js object
  const map = Immutable.fromJS({
    path: {
      to: {
        value: 41
      }
    }
  })

  // Fix value with awesome new notation
  map.setIn(dot('path.to.value'), 42)

Should very much work with require as well.

Test

No tests. Living on the edge.

Wait ... You can't be serious?

There's a module for that! No, not really. But it works!

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago