Coder Social home page Coder Social logo

t-osawa-009 / reswiftmonitor Goto Github PK

View Code? Open in Web Editor NEW
14.0 1.0 10.0 3.64 MB

ReSwift+redeux dev tools

License: MIT License

Ruby 1.43% Swift 97.02% Objective-C 1.10% Makefile 0.45%
swift redux reswift katana ios devtools redux-devtools redux-devtools-extension monitor middleware

reswiftmonitor's Introduction

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.

reswiftmonitor's People

Contributors

t-osawa-009 avatar troyswan avatar zeero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

reswiftmonitor's Issues

Remove HandyJSON

desc

  • 依存関係を少なくする為に自前でdecode & encodeする
  • Codableで実装してみる

Connection to `remotedev-server` fails

Hello,

I wanted to give you middleware a try but it seems there is an issue when establishing the connection to the remotedev-server.

Origin: Worker (PID 94704)
   [Warning] SocketProtocolError: Server received a message before the client handshake
    at SCServerSocket._onSCClose (/Users//.npm/_npx/94504/lib/node_modules/remotedev-server/node_modules/socketcluster-server/scserversocket.js:267:17)
    at WebSocket.<anonymous> (/Users/xxxx/.npm/_npx/94504/lib/node_modules/remotedev-server/node_modules/socketcluster-server/scserversocket.js:117:12)
    at WebSocket.emit (events.js:321:20)
    at Receiver.receiverOnMessage (/Users/xxxx/.npm/_npx/94504/lib/node_modules/remotedev-server/node_modules/ws/lib/websocket.js:800:20)
    at Receiver.emit (events.js:321:20)
    at Receiver.dataMessage (/Users/xxxx/.npm/_npx/94504/lib/node_modules/remotedev-server/node_modules/ws/lib/receiver.js:422:14)
    at Receiver.getData (/Users/xxxx/.npm/_npx/94504/lib/node_modules/remotedev-server/node_modules/ws/lib/receiver.js:352:17)
    at Receiver.startLoop (/Users/xxxx/.npm/_npx/94504/lib/node_modules/remotedev-server/node_modules/ws/lib/receiver.js:138:22)
    at Receiver._write (/Users/xxxx/.npm/_npx/94504/lib/node_modules/remotedev-server/node_modules/ws/lib/receiver.js:74:10)
    at doWrite (_stream_writable.js:453:12)
    at writeOrBuffer (_stream_writable.js:435:5)
    at Receiver.Writable.write (_stream_writable.js:326:11)
    at Socket.socketOnData (/Users/xxxx/.npm/_npx/94504/lib/node_modules/remotedev-server/node_modules/ws/lib/websocket.js:875:35)
    at Socket.emit (events.js:321:20)
    at addChunk (_stream_readable.js:305:12)
    at readableAddChunk (_stream_readable.js:280:11)

Tried it with node version v13.6.0 and the latest version of the remotedev-server package 0.3.1

Any idea what the issue might be?

Best regards
dp-1a

Types not showing up on state inspection

Types such as my enums and CGRects are not showing up in the state inspector. What would be the best way to add custom JSON encoding methods so they can show up when debugging?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.