0.9.2 • Published 6 years ago

monolite v0.9.2

Weekly downloads
516
License
MIT
Repository
-
Last release
6 years ago

Install

yarn add monolite

Babel Plugin

Monolite by default makes usage of ES2015 Proxy, which permits to transform accessor functions to accessor chains.

// Using accessor function
set(state, (_) => _.nested.prop, 42)

// Using accessor chain
set(state, ['nested', 'prop'], 42)

To target older runtimes, which do not support Proxy, a Babel plugin is available, doing these transformations statically, at compile-time.

Setup

yarn add --dev babel-plugin-monolite

In babel.config.js, simply add:

module.exports = (api) => {
  return {
    presets: [
      // ...
    ],
    plugins: ['babel-plugin-monolite'],
  }
}

Voilà, all your accessor functions will be transformed to accessor chains during transpilation.

TypeScript

The main motivation of this library is to preserve static-typing, type-inference and completion provided by TypeScript, which is not supported by Immutable.js when working on trees.

Monolite takes Plain-Old JavaScript Objects and returns Plain-Old JavaScript Objects. Accessors permit TypeScript to understand the types you're dealing with and to provide completion and linting as if you were working directly on these objects.

0.9.2

6 years ago

0.9.0

6 years ago

0.9.1

6 years ago

0.8.0

8 years ago

0.7.1

8 years ago

0.7.0

8 years ago

0.6.3

8 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.4.6

8 years ago

0.4.5

9 years ago

0.4.4

9 years ago

0.4.3

9 years ago

0.4.2

9 years ago

0.4.0

9 years ago

0.3.4

9 years ago

0.3.3

9 years ago

0.3.2

9 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.10

9 years ago

0.1.9

9 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago