File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 11# ObjectStore
2+
3+ [ ![ kotlin] ( https://img.shields.io/badge/kotlin-1.3.31-blue.svg )] ( )
4+
25###### Convenient interface for persisting objects.
36- Customizable serialization
47- Customizable encryption
@@ -15,6 +18,19 @@ fun example(store: ObjectStore) {
1518}
1619```
1720
21+ #### Define a model
22+
23+ ``` kotlin
24+ class AppData : ObjectStoreModel (InMemoryStore ()) {
25+ var username by stringItem()
26+ var age by intItem()
27+ var hasSeenOnboarding by booleanItem()
28+ var lastSeen by longItem()
29+ var rating by floatItem()
30+ }
31+ ```
32+
33+
1834## Observing
1935Each ` ObjectStore ` is (Rx) observable and will emit whenever something changes in store.
2036
@@ -46,4 +62,4 @@ fun conceal(context: Context) {
4662 transformer = ConcealTransformer (crypto)
4763 )
4864}
49- ```
65+ ```
You can’t perform that action at this time.
0 commit comments