Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcopiii/tardis
A super lite chronology tracker to save and navigate application states (or any data you want).
https://github.com/marcopiii/tardis
ios-lib state-management swift
Last synced: 25 days ago
JSON representation
A super lite chronology tracker to save and navigate application states (or any data you want).
- Host: GitHub
- URL: https://github.com/marcopiii/tardis
- Owner: marcopiii
- License: mit
- Created: 2019-10-23T10:58:27.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-03T19:25:28.000Z (over 4 years ago)
- Last Synced: 2024-09-29T14:32:53.405Z (about 1 month ago)
- Topics: ios-lib, state-management, swift
- Language: Swift
- Homepage:
- Size: 242 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A super lite chronology tracker to save and navigate application states (or any data you want).
No dependencies, lightweight & fully portable.## Overview
The funcionalities of Tardis are intentionally cut to the bone to provide a basic (yet very effective) way to keep a chronology of the state in a Redux-like architecture.
* __Create__ a Tardis instance
```swift
let stateTracker = Tardis()
```* __Save__ snapshots of the application state (or any other data you want to track)
```swift
stateTracker.save(snapshot: appState)
```* Make your application __time-travel__!
```swift
if stateTracker.hasPrevious {
appState = stateTracker.previous()
}
``````swift
if stateTracker.hasNext {
appState = stateTracker.next()
}
``````swift
appState = stateTracker.oldest()
``````swift
appState = stateTracker.latest()
```* Discard all snapshots and __restart__ with new tracking
```swift
stateTracker.reboot(with: appState)
```And that's almost all. Check documentation comments in quick help for more details about specific functions.
## Installation
You can install Tardis using __CocoaPods__.use_frameworks!
pod 'Tardis'
## Contribute- If you've __found a bug__, open an issue;
- If you have a __feature request__, open an issue;
- If you __want to contribute__, submit a pull request;## License
Tardis is available under the [MIT license](https://github.com/aSlug/Tardis/blob/master/LICENSE).