How to destroy a NightVision instance? #61
Unanswered
PavelSigeti
asked this question in
Q&A
Replies: 1 comment
-
This works, but I don't think it's the best way)
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I create several charts on page
chart = new NightVision('chart-container-${props.id}', { width: '100%', height: '400px', id: props.id, autoResize: true, colors: { back: "#1e1f22", grid: "#3C434D90", }, config: { DEFAULT_LEN: 150, MIN_ZOOM: 30, MAX_ZOOM: 510, }, scripts: [Candles, Tool], });
On Unmounted hook, I try to destroy instance
chart.events.off('${props.id}'); //1 way
chart.events.off('A-${chart.data.panes[0].uuid}'); //2 way
chart.events.off('rsi-${chart.data.panes[0].uuid}'); //3way
But I still can call keypress-event from navy-script
keypress(event) { if(event.key === 't') { console.log($core); } }
Beta Was this translation helpful? Give feedback.
All reactions