Skip to content

Instantly share code, notes, and snippets.

@cp-hardik-p
Created August 29, 2022 12:34
Show Gist options
  • Save cp-hardik-p/6112a4515c3bff985fc00764b629009c to your computer and use it in GitHub Desktop.
Save cp-hardik-p/6112a4515c3bff985fc00764b629009c to your computer and use it in GitHub Desktop.
//Reading employee object from a proto data store
val employeeInfo: Flow<EmployeePreference> = context.employeeProtoDataStore.data
.map {
it
}
//Reading employee object property empName from a proto data store
val empName: Flow<String> = context.employeeProtoDataStore.data
.map {
it.empName
}
//Reading employee object property empDesignation from a proto data store
val empDesignation: Flow<String> = context.employeeProtoDataStore.data
.map {
it.empDesignation
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment