FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [View Raw Code]   [Original HTTPS Page]

pythonnative/docs/api/storage.md at v0.41.0 · pythonnative/pythonnative · GitHub

Repository navigation

Latest commit

 

History

History
31 lines (25 loc) · 973 Bytes

File metadata and controls

31 lines (25 loc) · 973 Bytes

Storage

Key/value persistence backed by the platform-native store (NSUserDefaults on iOS, SharedPreferences on Android, a local JSON file in desktop tests). All operations are coroutines so they don't block the framework loop.

::: pythonnative.storage options: show_root_heading: false show_root_toc_entry: false members_order: source filters: ["!^_"]

Patterns

  • Token / session storage: write strings with [set][pythonnative.AsyncStorage] and read with [get][pythonnative.AsyncStorage].
  • Complex values: use [set_json][pythonnative.AsyncStorage] / [get_json][pythonnative.AsyncStorage] for dicts, lists, and primitives.
  • Component state that survives restarts: reach for [use_persisted_state][pythonnative.use_persisted_state] instead of manually wiring an effect to AsyncStorage.

Next steps


Back | FazBrowse Home | New Git URL