Skip to content

Commit

Permalink
Merge pull request #52 from mertdy/remove-flux
Browse files Browse the repository at this point in the history
Remove flux
  • Loading branch information
Kikobeats authored Dec 25, 2024
2 parents 459d60b + ae4d7ea commit c99c5ae
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@
{
"name": "REDMOND\\xuefl",
"email": "[email protected]"
},
{
"name": "Mert Donmezyurek",
"email": "[email protected]"
}
],
"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

0 comments on commit c99c5ae

Please sign in to comment.