Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@microlink/react-json-view",
"description": "Interactive react component for displaying javascript arrays and JSON objects.",
"homepage": "https://github.com/microlinkhq/react-json-view",
"version": "1.23.4",
"version": "1.24.0",
Comment thread
Kikobeats marked this conversation as resolved.
Outdated
"main": "dist/main.js",
"author": {
"name": "Mac Gainor"
Expand Down Expand Up @@ -171,6 +171,10 @@
{
"name": "REDMOND\\xuefl",
"email": "xuefl@microsoft.com"
},
{
"name": "Mert Donmezyurek",
"email": "info@mertdy.com"
}
],
"repository": {
Expand Down Expand Up @@ -203,7 +207,6 @@
"treeview"
],
"dependencies": {
"flux": "~4.0.1",
"react-base16-styling": "~0.9.0",
"react-lifecycles-compat": "~3.0.4",
"react-textarea-autosize": "~8.3.2"
Expand Down
19 changes: 17 additions & 2 deletions src/js/helpers/dispatcher.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
import { Dispatcher } from 'flux'
const dispatcher = new Dispatcher()
class Dispatcher {
handler = () => {}

register(handler) {
this.handler = handler
}

dispatch(data) {
this.handler?.(data)
}
}

if (!globalThis.__globalDispatcherInstance) {
globalThis.__globalDispatcherInstance = new Dispatcher()
}

const dispatcher = globalThis.__globalDispatcherInstance
export default dispatcher