Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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).

Awesome Lists containing this project

README

        


Tardis






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).