File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 11[ ![ Download] ( https://api.bintray.com/packages/elementsinteractive/maven/ObjectStore/images/download.svg ) ] ( https://bintray.com/elementsinteractive/maven/ObjectStore/_latestVersion )
22# ObjectStore
3+
4+ [ ![ kotlin] ( https://img.shields.io/badge/kotlin-1.3.31-blue.svg )] ( )
5+
36###### Convenient interface for persisting objects.
47``` groovy
58implementation "nl.elements.objectstore:objectstore:+"
@@ -19,6 +22,19 @@ fun example(store: ObjectStore) {
1922}
2023```
2124
25+ #### Define a model
26+
27+ ``` kotlin
28+ class AppData : ObjectStoreModel (InMemoryStore ()) {
29+ var username by stringItem()
30+ var age by intItem()
31+ var hasSeenOnboarding by booleanItem()
32+ var lastSeen by longItem()
33+ var rating by floatItem()
34+ }
35+ ```
36+
37+
2238## Observing
2339Each ` ObjectStore ` is (Rx) observable and will emit whenever something changes in store.
2440
You can’t perform that action at this time.
0 commit comments