Skip to content

Commit

Permalink
fix: update return type of every method in pulse/every.ts & update da…
Browse files Browse the repository at this point in the history
…tabase method in Pulse class to be public (#11)

* docs: update README.md with links to documentation and website

* fix: update return type of every method in pulse/every.ts

* fix: update database method in Pulse class to be public
  • Loading branch information
code-xhyun authored Apr 16, 2024
1 parent de13e5f commit 27d660c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

<br><!-- TABLE OF CONTENTS -->


<p align="center">
<a href="https://docs-pulse.pulsecron.com">Documentation</a> | <a href="https://www.pulsecron.com">Website</a>
</p>
<details>
<summary>Table of Contents</summary><br>

Expand Down Expand Up @@ -170,8 +172,7 @@ Pulse is a new fork of the [Agenda](https://github.com/agenda/agenda) project, c
<br/>

## Getting Started


| Take a look at our [Quick Start](https://docs-pulse.pulsecron.com/quick-start) guide.

#### Installation

Expand Down
4 changes: 2 additions & 2 deletions src/pulse/every.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type EveryMethod = <T extends any>(
names: string | string[],
data?: T,
options?: JobOptions
) => Promise<any>;
) => Promise<Job | Job[] | undefined>;

/**
* Creates a scheduled job with given interval and name/names of the job to run
Expand All @@ -22,7 +22,7 @@ export type EveryMethod = <T extends any>(
* @param options - options to run job for
* @returns Job/s created. Resolves when schedule fails or passes
*/
export const every: EveryMethod = async function (this: Pulse, interval, names, data?, options?): Promise<any> {
export const every: EveryMethod = async function (this: Pulse, interval, names, data?, options?) {
/**
* Internal method to setup job that gets run every interval
* @param interval run every X interval
Expand Down
8 changes: 4 additions & 4 deletions src/pulse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,16 @@ class Pulse extends EventEmitter {
return this.bindMethod('mongo', mongo);
}

get database(): DatabaseMethod {
return this.bindMethod('database', database);
}

/**
***************************************
* Private methods
* *************************************
*/

private get database(): DatabaseMethod {
return this.bindMethod('database', database);
}

private init(config: PulseConfig, cb?: (error: AnyError | undefined, collection: Collection<any> | null) => void) {
if (config.mongo) {
this.mongo(config.mongo, config.db ? config.db.collection : undefined, cb); // @ts-expect-error // the documentation shows it should be correct: http://mongodb.github.io/node-mongodb-native/3.6/api/Db.html
Expand Down

0 comments on commit 27d660c

Please sign in to comment.