-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: matt-ramotar <[email protected]>
- Loading branch information
1 parent
879bf9f
commit dbe3835
Showing
7 changed files
with
23 additions
and
113 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,129 +1,38 @@ | ||
<div align="center"> | ||
<img src="Images/friendly_robot.png" width="120"/> | ||
<h1 style="font-size:48px">Store5</h1> | ||
</div> | ||
|
||
[![codecov](https://codecov.io/gh/MobileNativeFoundation/Store/branch/main/graph/badge.svg?token=0UCmG3QHPf)](https://codecov.io/gh/MobileNativeFoundation/Store) | ||
|
||
<div align="center"> | ||
<h4>Full documentation can be found on our <a href="https://mobilenativefoundation.github.io/Store/">website</a>!</h4> | ||
<h4>Join our official Slack on <a href="https://kotlinlang.slack.com/archives/C06007Z01HU">kotlinlang</a>!</h4> | ||
</div> | ||
|
||
### Concepts | ||
|
||
- [Store](https://mobilenativefoundation.github.io/Store/store/store/) is a typed repository that returns a flow | ||
of [Data](https://github.com/MobileNativeFoundation/Store/blob/main/store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/StoreReadResponse.kt#L39) | ||
/[Loading](https://github.com/MobileNativeFoundation/Store/blob/main/store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/StoreReadResponse.kt#L34) | ||
/[Error](https://github.com/MobileNativeFoundation/Store/blob/main/store/src/commonMain/kotlin/org/mobilenativefoundation/store/store5/StoreReadResponse.kt#L51) | ||
from local and network data sources | ||
- [MutableStore](https://mobilenativefoundation.github.io/Store/mutable-store/building/overview/) is a mutable repository implementation that allows create **(C)**, read **(R)**, | ||
update **(U)**, and delete **(D)** operations for local and network resources | ||
- [SourceOfTruth](https://mobilenativefoundation.github.io/Store/mutable-store/building/implementations/source-of-truth/) persists items | ||
- [Fetcher](https://mobilenativefoundation.github.io/Store/mutable-store/building/implementations/fetcher/) defines how data will be fetched over network | ||
- [Updater](https://mobilenativefoundation.github.io/Store/mutable-store/building/implementations/updater/) defines how local changes will be pushed to network | ||
- [Bookkeeper](https://mobilenativefoundation.github.io/Store/mutable-store/building/implementations/bookkeeper/) tracks metadata of local changes and records | ||
synchronization failures | ||
- [Validator](https://mobilenativefoundation.github.io/Store/mutable-store/building/implementations/validator/) returns whether an item is valid | ||
- [Converter](https://mobilenativefoundation.github.io/Store/mutable-store/building/implementations/converter/) converts items | ||
between [Network](https://mobilenativefoundation.github.io/Store/mutable-store/building/generics/network) | ||
/[Local](https://mobilenativefoundation.github.io/Store/mutable-store/building/generics/sot) | ||
/[Output](https://mobilenativefoundation.github.io/Store/mutable-store/building/generics/common) representations | ||
|
||
### Including Store In Your Project | ||
|
||
#### Android | ||
```kotlin | ||
implementation "org.mobilenativefoundation.store:store5:5.1.0-alpha05" | ||
``` | ||
|
||
#### Multiplatform (Common, JVM, Native, JS) | ||
|
||
```kotlin | ||
commonMain { | ||
dependencies { | ||
implementation("org.mobilenativefoundation.store:store5:5.1.0-alpha05") | ||
} | ||
} | ||
``` | ||
|
||
### Getting Started | ||
|
||
#### Building Your First Store | ||
|
||
```kotlin | ||
StoreBuilder | ||
.from<Key, Network, Output, Local>(fetcher, sourceOfTruth) | ||
.converter(converter) | ||
.validator(validator) | ||
.build(updater, bookkeeper) | ||
``` | ||
|
||
#### Creating | ||
<img src=".github/images/hero-light.svg" width="100%"/> | ||
|
||
##### Request | ||
# Store5 | ||
|
||
```kotlin | ||
store.write( | ||
request = StoreWriteRequest.of<Key, Output, Response>( | ||
key = key, | ||
value = value | ||
) | ||
) | ||
``` | ||
|
||
##### Response | ||
|
||
```text | ||
1. StoreWriteResponse.Success.Typed<Response>(response) | ||
``` | ||
|
||
#### Reading | ||
|
||
##### Request | ||
|
||
```kotlin | ||
store.stream<Response>(request = StoreReadRequest.cached(key, refresh = false)) | ||
``` | ||
[![codecov](https://codecov.io/gh/MobileNativeFoundation/Store/branch/main/graph/badge.svg?token=0UCmG3QHPf)](https://codecov.io/gh/MobileNativeFoundation/Store) | ||
|
||
##### Response | ||
#### Documentation | ||
|
||
```text | ||
1. StoreReadResponse.Data(value, origin = StoreReadResponseOrigin.Cache) | ||
``` | ||
Comprehensive guides, tutorials, and API reference: [store.mobilenativefoundation.org](https://store.mobilenativefoundation.org). | ||
|
||
#### Updating | ||
#### Getting Started | ||
|
||
##### Request | ||
1. Start with the [Quickstart](https://store.mobilenativefoundation.org/docs/quickstart) to build your first Store. | ||
2. Dive into [Store Foundations](https://store.mobilenativefoundation.org/docs/concepts) to learn how Store works. | ||
3. Check out [Handling CRUD](https://store.mobilenativefoundation.org/docs/use-cases/store5/setting-up-store-for-crud-operations) for an advanced guide on supporting create, read, update, and delete operations. | ||
|
||
```kotlin | ||
store.write( | ||
request = StoreWriteRequest.of<Key, Output, Response>( | ||
key = key, | ||
value = newValue | ||
) | ||
) | ||
``` | ||
#### Getting Help | ||
|
||
##### Response | ||
Join our community in the [#store](https://kotlinlang.slack.com/archives/C06007Z01HU) channel on the official Kotlin Slack. | ||
|
||
```text | ||
1. StoreWriteResponse.Success.Typed<Response>(response) | ||
``` | ||
#### Getting Involved | ||
|
||
#### Deleting | ||
Store has a vibrant community of contributors. We welcome contributions of all kinds. Please see our [Contributing Guidelines](CONTRIBUTING.md) for more information on how to get involved. | ||
|
||
##### Request | ||
#### Backed By | ||
|
||
```kotlin | ||
store.clear(key) | ||
``` | ||
<div style="display: flex; align-items: center; gap: 20px;"> | ||
<img src=".github/images/mobile-native-foundation.png" width="200"/> | ||
<img src=".github/images/kotlin-foundation.png" width="200"/> | ||
</div> | ||
|
||
### License | ||
#### License | ||
|
||
```text | ||
Copyright (c) 2024 Mobile Native Foundation. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters