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

Bring @masylum PR and @diasdavid PR to be a PR from a ipfs/js-ipfs-repo branch to master #2

Merged
merged 6 commits into from
Dec 10, 2015

Conversation

daviddias
Copy link
Member

Makes contribution easier :)

@daviddias daviddias mentioned this pull request Dec 10, 2015
Read/Write the version number of that repository.

```js
repo.version().read(function (err, num) {
Copy link
Member Author

Choose a reason for hiding this comment

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

any specific reason why version() has to be a func?

Copy link
Contributor

Choose a reason for hiding this comment

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

it was easier to develop but we can indeed have a better API

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm "injecting" the store on each of those (https://github.com/ipfs/js-ipfs-repo/pull/2/files#diff-1fdf421c05c1140f6d71444ea2b27638R36). I can improve that I guess.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added a load method, so that we can have a pre state where we can check if a repo exists, but without loading some of the variables to memory (things like version or config that can be read once), and also start the remaining stores, avoiding the need to have inject the 'store' for each call :)

Copy link
Contributor

Choose a reason for hiding this comment

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

better. Any reason why is this not in the constructor?

*/
readWithoutLock: function (key, cb) {
return this.read(key, cb)
},
Copy link
Contributor

Choose a reason for hiding this comment

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

This is something that I'm not fully sure about. Should the locks be on the API?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if we will want to use it directly, but won't hurt having them available/thought through :)

module.exports = {
version: require('./version'),
config: require('./config'),
// logs: require('./logs'),
Copy link
Contributor

Choose a reason for hiding this comment

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

those are meant to disappear from the repos

@daviddias
Copy link
Member Author

I'm going to merge this and publish to npm, so that we can start jsipfs with a good precedent of having tests passing on travis, as we ship items from the Roadmap ipfs/team-mgmt#71

daviddias added a commit that referenced this pull request Dec 10, 2015
Bring @masylum PR and @diasdavid PR to be a PR from a ipfs/js-ipfs-repo branch to master
@daviddias daviddias merged commit e3dcf55 into master Dec 10, 2015
@achingbrain achingbrain deleted the masylum/initial-implementation branch September 13, 2021 07:17
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.

2 participants