Skip to content

t-osawa-009/ReSwiftMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f37fdfb · Oct 29, 2022

History

73 Commits
Oct 29, 2022
Jul 6, 2019
Aug 16, 2020
Aug 14, 2020
Oct 29, 2022
Feb 2, 2018
May 16, 2019
Mar 22, 2019
Feb 21, 2020
Aug 14, 2020
Aug 14, 2020
Aug 23, 2018
Feb 21, 2020
Oct 29, 2022
Oct 29, 2022
Oct 27, 2022
Oct 29, 2022

Repository files navigation

ReSwiftMonitor

ReSwift middleware that can be used to communicate with redux-dev tools. It has been tested with redux-devtools cli, but it should work with other monitors too. This project is heavily inspired by the katanaMonitor-lib-swift.

gif

Dependencies

Install the redux-devtools cli once:

npm install -g @redux-devtools/cli

Run the standalone application (every time you want to use the monitor)

redux-devtools --open

Project Integration

The monitor is shipped using Cocoapods.

Pod

Add the pod ReSwiftMonitor

pod 'ReSwiftMonitor', :configurations => ['Debug']
Carthage
github "t-osawa-009/ReSwiftMonitor"

The middleware should be used in debug configurations only.

In your application, conditionally add the middleware. Here, for instance, we use the DEBUG macro to conditionally add the middleware in debug configurations only:

var middleware: [Middleware<AppState>] = {
    var _middleware: [Middleware<AppState>] = []
    #if DEBUG
    let monitorMiddleware = MonitorMiddleware.make(configuration: Configuration())
    _middleware.append(monitorMiddleware)
    #endif
    return _middleware
}()

let store = Store<AppState>(reducer: AppState.reducer(), state: AppState(), middleware: middleware)

Usage

  • Launch redux-devtools in your terminal
  • Click settings and make sure that Use custom local server is selected and the configuration is the proper ones (by default localhost and 8000). This is the UI where actions will appear
  • Launch your Reswift application

More

Libraries Used

Contributing

There's still a lot of work to do here. We would love to see you involved. You can find all the details on how to get started in the Contributing Guide.

License

ReSwiftMonitor is released under the MIT license. See LICENSE for details.