0.2.0 • Published 2 years ago

composite-call-with-dates v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

composite-call-with-dates

Package which makes ts-transformer-dates and composite-call packages work well together

npm version npm downloads vulnerabilities

Install

npm install composite-call-with-dates

Or

yarn add composite-call-with-dates

Usage

  1. Replace dates and composite-call transformers with this transformer:
- const datesTransformer = require('ts-transformer-dates/lib/transformer').default;
- const composeTransformer = require('composite-call/dist/transformer');
+ const composeWithDatesTransfomrer = require('composite-call-with-dates/dist/transformer').default;

module.exports = {
  module: {
    rules: [
      {
        test: /\.tsx?$/,
        loader: 'awesome-typescript-loader',
        options: {
          getCustomTransformers: function(program) {
            return {
                before: [
-                   composeTransformer(program),
-                   datesTransformer(program),
+                   composeWithDatesTransfomrer
                ],
            };
          },
        },
      },
    ]
  }
}
  1. And then, instead of:
import { compose } from 'composite-call';

Use:

import { compose } from 'composite-call-with-dates';

And that's it!

More information

More information about Api and transformers you can find here:

License

MIT © Artiom Tretjakovas

Created with aqu 🌊