Closed robrechtme closed 1 year ago
Hi @yutasuzuki
There isn't really a convention, I've seen snake_case
, UPPER_SNAKE_CASE
and pascalCase
being used. What would be a bit cleaner is using an object instead of plain strings, e.g.
const RecordingResult = {
Started = 'started',
PermissionError = 'permission_error'
} as const;
type RecordingResult = typeof RecordingResult[keyof typeof RecordingResult];
const res: RecordingResult = await RecordScreen.startRecording();
if (res === RecordingResult.PermissionError) {
// user denies access
}
This would not break the current API as the started
value is still the same.
@robrechtme That's great! I'd be happy to pull request that code!
Hi @yutasuzuki
I updated the code to do that 🙂
@robrechtme Thanks. Please let me consult with you. The "permission_error" is written in snake case. I would like to know the standard naming rules for other react native libraries, native android and native ios. If you know it, I would appreciate it if you could let me know.