Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reswift/reswift-recorder
Deprecated ⚠️ Proof-of-concept Time Travel and Hot Reloading for ReSwift 3.0
https://github.com/reswift/reswift-recorder
redux reswift
Last synced: about 2 months ago
JSON representation
Deprecated ⚠️ Proof-of-concept Time Travel and Hot Reloading for ReSwift 3.0
- Host: GitHub
- URL: https://github.com/reswift/reswift-recorder
- Owner: ReSwift
- License: mit
- Created: 2015-12-15T08:42:58.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-10-15T17:27:54.000Z (about 6 years ago)
- Last Synced: 2024-10-31T15:43:01.522Z (about 2 months ago)
- Topics: redux, reswift
- Language: Swift
- Homepage: https://github.com/ReSwift/ReSwift
- Size: 2.11 MB
- Stars: 138
- Watchers: 9
- Forks: 18
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Swift-Flow/Swift-Flow/blob/master/LICENSE.md)A recording store for [ReSwift][]. Enables hot-reloading and time travel for ReSwift apps.
# ⚠️ ReSwift-Recorder is Deprecated
⚠️ Proof of concept. Needs a lot of love! ⚠️
The recorder was written to work with [ReSwift][] v3. It uses an internal state setter which is not supported by more recent releases of ReSwift; so the recorder would need to be rewritten.
[reswift]: https://github.com/ReSwift/ReSwift
# About ReSwiftRecorder
ReSwiftRecorder is an extension for ReSwift that allows developers to record and replay actions. ReSwiftRecorder supports serializing these actions to disk, which allows to replay recorded sessions and to restart apps at the point you left them off.
This is especially useful during development. If you run into a crash, while recording, you now have a recorded JSON file with all the actions needed to reproduce crash. If you restart your app with this recorded session, it will crash in exactly the same way every single time - this allows you to fix the underlying issue without manually navigating through the app over and over again.
The long term goal of this extension is to implement some of the most important features from [Redux Devtools](https://github.com/gaearon/redux-devtools).
**This extension is working - you can record and replay actions, but it still in a proof-of-concept state**.
## Next Steps
- Make it easier for developers to make actions serializable, ideally cutting down on some of the boilerplate code that is currently necessary.
- Improve the implementation of this extension, the current implementation is a hack.## CocoaPods
You can install ReSwiftRecorder via CocoaPods by adding it to your `Podfile`:
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'pod 'ReSwift'
pod 'ReSwiftRecorder'
And run `pod install`.## Carthage
You can install ReSwiftRecorder via [Carthage]() by adding the following line to your Cartfile:
github "ReSwift/ReSwift-Recorder"
# Configuration
When creating your app's store you need to create an instance of `RecordingStore` instead of an instance of `MainStore`. You also need to provide a `typeMaps` argument that is used to deserialize actions:
```swift
RecordingMainStore(reducer: CombinedReducer([CounterReducer(), NavigationReducer()]),
appState: AppState(), typeMaps:[counterActionTypeMap, ReSwiftRouter.typeMap], recording: "recording.json")
```
The `typeMaps` array is an array that maps type names (Strings) to action types.
The last argument `recording`, can either be `nil` or the path to a recording stored in the documents directory of the app. If you set the path to a specific recording, the store will load all actions upon launch and replay them, thereby restoring the state of the application.For a practical example of how to use ReSwiftRecorder, check out the [Counter App Example](https://github.com/ReSwift/CounterExample-Navigation-TimeTravel).