{"id":20688589,"url":"https://github.com/flutter-dart-open-source/rx_storage","last_synced_at":"2025-04-22T15:42:53.714Z","repository":{"id":39335687,"uuid":"312520729","full_name":"Flutter-Dart-Open-Source/rx_storage","owner":"Flutter-Dart-Open-Source","description":"Reactive storage for Dart/Flutter. RxDart Storage for Dart/Flutter.","archived":false,"fork":false,"pushed_at":"2025-04-14T21:52:42.000Z","size":175,"stargazers_count":9,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T22:34:53.145Z","etag":null,"topics":["dart","dart-reactive-storage","dart-rx-storage","flutter-reactive","flutter-reactive-storage","flutter-rx-preferences","flutter-rx-storage","flutter-rxdart","reactive-storage","rx-shared-preferences","rx-storage","rxdart","rxdart-bloc","rxdart-flutter","rxstorage"],"latest_commit_sha":null,"homepage":"https://github.com/hoc081098","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Flutter-Dart-Open-Source.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["hoc081098"],"buy_me_a_coffee":"hoc081098"}},"created_at":"2020-11-13T08:46:42.000Z","updated_at":"2024-07-19T18:20:59.000Z","dependencies_parsed_at":"2024-01-30T21:44:51.630Z","dependency_job_id":"37bbaaaf-2e57-4d9a-a6d0-035abd79a71d","html_url":"https://github.com/Flutter-Dart-Open-Source/rx_storage","commit_stats":{"total_commits":69,"total_committers":3,"mean_commits":23.0,"dds":0.07246376811594202,"last_synced_commit":"bf63a09a46d39086ba557019687eb40a351cf15a"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flutter-Dart-Open-Source%2Frx_storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flutter-Dart-Open-Source%2Frx_storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flutter-Dart-Open-Source%2Frx_storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flutter-Dart-Open-Source%2Frx_storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Flutter-Dart-Open-Source","download_url":"https://codeload.github.com/Flutter-Dart-Open-Source/rx_storage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250270029,"owners_count":21402981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","dart-reactive-storage","dart-rx-storage","flutter-reactive","flutter-reactive-storage","flutter-rx-preferences","flutter-rx-storage","flutter-rxdart","reactive-storage","rx-shared-preferences","rx-storage","rxdart","rxdart-bloc","rxdart-flutter","rxstorage"],"created_at":"2024-11-16T23:06:12.599Z","updated_at":"2025-04-22T15:42:53.692Z","avatar_url":"https://github.com/Flutter-Dart-Open-Source.png","language":"Dart","funding_links":["https://github.com/sponsors/hoc081098","https://buymeacoffee.com/hoc081098","https://www.buymeacoffee.com/hoc081098"],"categories":[],"sub_categories":[],"readme":"# rx_storage ![alt text](https://avatars3.githubusercontent.com/u/6407041?s=32\u0026v=4)\n\nReactive storage for Dart/Flutter. RxDart Storage for Dart/Flutter.\n\n## [rx_shared_preferences](https://github.com/hoc081098/rx_shared_preferences) is an extension of this package, check it out!\n\n## Author: [Petrus Nguyễn Thái Học](https://github.com/hoc081098)\n[![Pub Version](https://img.shields.io/pub/v/rx_storage?style=flat)](https://pub.dev/packages/rx_storage)\n[![Pub Version](https://img.shields.io/pub/v/rx_storage?style=flat\u0026include_prereleases)](https://pub.dev/packages/rx_storage)\n[![codecov](https://codecov.io/gh/Flutter-Dart-Open-Source/rx_storage/branch/master/graph/badge.svg?token=6eORcR6Web)](https://codecov.io/gh/Flutter-Dart-Open-Source/rx_storage)\n[![Dart CI](https://github.com/Flutter-Dart-Open-Source/rx_storage/actions/workflows/dart.yml/badge.svg)](https://github.com/Flutter-Dart-Open-Source/rx_storage/actions/workflows/dart.yml)\n[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FFlutter-Dart-Open-Source%2Frx_storage\u0026count_bg=%2379C83D\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23E7E7E7\u0026title=hits\u0026edge_flat=false)](https://hits.seeyoufarm.com)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Style](https://img.shields.io/badge/style-lints-40c4ff.svg)](https://pub.dev/packages/lints)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/Flutter-Dart-Open-Source/rx_storage/blob/master/screenshots/logo.png?raw=true\" height=\"200\" alt=\"RxDart\" /\u003e\n\u003c/p\u003e\n\nLiked some of my work? Buy me a coffee (or more likely a beer).\n\n\u003ca href=\"https://www.buymeacoffee.com/hoc081098\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-blue.png\" alt=\"Buy Me A Coffee\" height=64\u003e\u003c/a\u003e\n\n## More detail about returned `Stream`\n\n-   It's a **single-subscription `Stream`** (ie. it can only be listened once).\n\n-   `Stream` will emit the **value (nullable)** or **a `TypeError`** as its first event when it is listen to.\n\n-   It will automatically emit value when value associated with key was changed successfully\n    (**emit `null`** when value associated with key was `removed` or set to `null`).\n\n-   When value read from Storage has a type other than expected type:\n    -   If value is `null`, the `Stream` will **emit `null`** (this occurred because `null` can be cast to any nullable type).\n    -   Otherwise, the `Stream` will **emit a `TypeError`**.\n\n-   **Can emit** two consecutive data events that are equal. You should use Rx operator like `distinct` (More commonly known as `distinctUntilChanged` in other Rx implementations) to create an `Stream` where data events are skipped if they are equal to the previous data event.\n\n```text\nKey changed:  |----------K1---K2------K1----K1-----K2---------\u003e time\n              |                                                \nValue stream: |-----@----@------------@-----@-----------------\u003e time\n              |    ^                                      \n              |    |\n              |  Listen(key=K1)\n              |\n              |  @: nullable value or TypeError\n```\n## Usage\n\nA simple usage example:\n\n```dart\nimport 'package:rx_storage/rx_storage.dart';\n\nclass StorageAdapter implements Storage\u003cString, void\u003e { ... }\n\nmain() async {\n  final adapter = StorageAdapter();\n  final rxStorage = RxStorage\u003cString, void\u003e(adapter);\n\n  rxStorage.observe('key', (v) =\u003e v as String?).listen((String? s) { ... });\n  await rxStorage.write('key', 'a String', (v) =\u003e v);\n  await rxStorage.read('key', (v) =\u003e v as String?);\n}\n```\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker][tracker].\n\n[tracker]: https://github.com/Flutter-Dart-Open-Source/rx_storage/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflutter-dart-open-source%2Frx_storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflutter-dart-open-source%2Frx_storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflutter-dart-open-source%2Frx_storage/lists"}