Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

made a library more customisable for defining a key form which to take a unique value #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ghost
Copy link

@ghost ghost commented Sep 19, 2022

No description provided.

Copy link
Owner

@fent fent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! thank you for this PR. I think it's a good idea to do this as your use case showed. left some comments

@@ -110,3 +116,36 @@ Tests are written with [mocha](https://mochajs.org)
```bash
npm test
```

#Example of usage
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's already an example at the top of the readme

});
reader.read();

setInterval(() => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for this with the interval option

@@ -8,7 +8,7 @@
"json",
"subscribe"
],
"version": "0.7.6",
"version": "0.7.9",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the package auto updates the version once a PR is merged

requestOpts: {},

// keys to get a unique value from items, first not null will be used
uniqueKeyNames: ['guid'],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the default values, ['pubdate', 'lastbuilddate', 'updated']

@@ -64,8 +70,15 @@ export default class FeedSub extends TypedEmitter<FeedSubEvents> {
skipDays : false,
daysToSkip : null,
requestOpts : {},
uniqueKeyNames : ['pubdate', 'lastbuilddate', 'updated'],
getUniqueValueFromItem: false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think of removing this field and always using uniqueKeyNames?

@@ -56,6 +61,7 @@ export default class FeedSub extends TypedEmitter<FeedSubEvents> {
forceInterval : false,
autoStart : false,
emitOnStart : false,
lastUniqueIdentifierValue : null,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about lastUniqueKey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants