-
Notifications
You must be signed in to change notification settings - Fork 25
Add file system data functions as shorthand methods #464
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, much more scalable! 🎉
src/index.ts
Outdated
loadFileSystem: (username: string) => loadFileSystem({ config, username, dependencies: components }), | ||
recoverFileSystem: (params: RecoverFileSystemParams) => recoverFileSystem({ auth, dependencies: components, ...params }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we have fileSystem.load
and fileSystem.recover
, should we remove the loadFileSystem
and recoverFileSystem
shorthands?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could yeah.
|
||
fileSystem: { | ||
addPublicExchangeKey: (fs: FileSystem) => FileSystemData.addPublicExchangeKey(components.crypto, fs), | ||
addSampleData: (fs: FileSystem) => FileSystemData.addSampleData(fs), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the use cases where developer would want to use this shorthand? I could see where it could see it being useful for quick experimentation, but I don't think developers will want exactly the directories it creates.
If we are the primary consumer of the shorthand, we should consider leaving it buried to keep the top-level API as simple as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The public key ones would be for whenever you have an app that you want to receive a private share on. The behaviour of these functions will change over time (eg. rs-wnfs will keep exchange keys in the root).
The sample data one would be for apps like Drive, which is less useful, but doesn't hurt to have it there I guess, even if it's for quick experimentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, the public key ones are good additions 👌. I was questioning addSampleData
.
Adding addSampleData
has some cost because it's another bit of API for developers to learn. If it has a good use case for them, then it's worth adding. Otherwise, we should consider leaving it out.
It seems like quick experimentation is a secondary use case. If we want to support the quick experimentation, maybe addSampleData
could add a file in addition to directories?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a file 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👌
|
||
fileSystem: { | ||
addPublicExchangeKey: (fs: FileSystem) => FileSystemData.addPublicExchangeKey(components.crypto, fs), | ||
addSampleData: (fs: FileSystem) => FileSystemData.addSampleData(fs), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👌
17fd43d
to
ebcba8f
Compare
…fileSystem functions
Closes #448