Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
fix(subscriptions): Allows you to subscribe to * and see the entire s…
Browse files Browse the repository at this point in the history
…tore
  • Loading branch information
thibmaek authored and rmevans9 committed Dec 10, 2018
1 parent fa1060d commit 02501fe
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/reactotron-core-server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { merge, find, propEq, without, contains, forEach, pluck, reject } from "ramda"
import { merge, find, propEq, without, contains, forEach, pluck, reject, equals } from "ramda"
import { Server as WebSocketServer, OPEN } from "ws"
import * as mitt from "mitt"
import validate from "./validation"
Expand Down Expand Up @@ -292,9 +292,16 @@ export default class Server {
if (contains(path, this.subscriptions)) {
return
}

// monitor the complete state when * (star selector) is entered
if (equals(path, '*')) {
this.subscriptions.push('')
} else {
this.subscriptions.push(path)
}


// subscribe
this.subscriptions.push(path)
this.stateValuesSendSubscriptions()
}

Expand Down

0 comments on commit 02501fe

Please sign in to comment.