question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add TypeScript support

See original GitHub issue

As explained in this issue, the new node-cron version had a breaking change.

The third param, of schedule function, immediateStart was removed and replaced by a options.

The behavior of immediateStart was replaced by the option scheduled.

So, to fix this issue we had two options:

1 - Update the lib https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-cron

2 - Introduce a typings on node-cron project.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
jacob-hdcommented, Oct 8, 2018

Typings would be great.

0reactions
merenciacommented, Oct 17, 2018

because I don’t want to expose the scheduler.

For example, now I have something like this:

constructor(cronExpression, func, options) {
   //...
   let scheduler = new Scheduler(cronExpression, options.timezone, options.recoverMissedExecutions);
  //...

  this.start = () => {
      scheduler.start();
   };
}

If I change that to methods I need to put the scheduler in the instance, the scheduler may be accessed through scheduledTask.scheduler.

constructor(cronExpression, func, options) {
   //...
   this.scheduler = new Scheduler(cronExpression, options.timezone, options.recoverMissedExecutions);
  //...
}

start() {
  this.scheduler.start();
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set up TypeScript
You can use npm to install TypeScript globally, this means that you can use the tsc command anywhere in your terminal. To do...
Read more >
How to Add TypeScript to a JavaScript Project
How to convert a JavaScript application to support TypeScript. · Install typescript · Typescript config file · Create your first .TS file in...
Read more >
Add TypeScript support to an existing codebase | by Billel
Add TypeScript support to an existing codebase · Install typescript npm package and node type definitions. Just run npm i --save-dev typescript @types/node ......
Read more >
Adding TypeScript
Global installs of create-react-app are no longer supported. To add TypeScript to an existing Create React App project, first install it:.
Read more >
Adding TypeScript-support to your Node.js project
If your application already has build tooling set up via webpack, the easiest way to add TypeScript support is by using the ts-loader...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found