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
Adds dataAtPath method to API #46
Conversation
@@ -2,6 +2,11 @@ import { NativeModules } from 'react-native' | |||
|
|||
const { TextileNode } = NativeModules | |||
|
|||
export async function dataAtPath(path: string): Promise<string> { | |||
const result = await TextileNode.dataAtPath(path) | |||
return result as string |
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.
Buffer
(UIntArray
) could be a better return type for "data".
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.
Or is the string returned a data url?
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 data could be anything at that path. So, no way to properly construct a data URL. It just returns a byte slice: func (m *Mobile) DataAtPath(pth string) ([]byte, error)
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.
Makes sense. This should return Buffer
or UIntArray
then.
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 okay, i just got lucky in that the string could just be dropped into the rn image uri
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.
Surprised that worked. Maybe RN Image
has some default handling of string values that made it work.
yeah, data url |
No description provided.