@equinor/fusion
Advanced tools
Comparing version 0.4.5 to 0.4.6
@@ -1,2 +0,2 @@ | ||
import { createContext, useContext } from "react"; | ||
import { createContext, useContext, useEffect, useState } from "react"; | ||
import { useFusionContext } from "../core/FusionContext"; | ||
@@ -7,3 +7,9 @@ export const HistoryContext = createContext({ history: null }); | ||
const historyContext = useContext(HistoryContext); | ||
const history = historyContext.history || fusionContext.history; | ||
const [_, forceUpdate] = useState(null); | ||
useEffect(() => { | ||
const listner = history.listen(() => forceUpdate(null)); | ||
return listner; | ||
}, [history]); | ||
return historyContext.history || fusionContext.history; | ||
}; |
@@ -1,2 +0,2 @@ | ||
declare const _default: "0.4.5"; | ||
declare const _default: "0.4.6"; | ||
export default _default; |
@@ -1,1 +0,1 @@ | ||
export default '0.4.5'; | ||
export default '0.4.6'; |
{ | ||
"name": "@equinor/fusion", | ||
"version": "0.4.5", | ||
"version": "0.4.6", | ||
"description": "Everything a Fusion app needs to communicate with the core", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
170734
4063