File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
frameworks/react/workspace/src/views Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ import OpenFin from "@openfin/core" ;
12import React , { useEffect , useState } from "react" ;
23import logo from "../logo.svg" ;
34
@@ -33,6 +34,22 @@ function View2() {
3334 }
3435 }
3536
37+ function handleSaveCustomData ( ) {
38+ console . log ( 'Setting custom data' ) ;
39+ const view = fin . me as OpenFin . View
40+ view . updateOptions ( {
41+ customData : {
42+ foo : 'bar'
43+ }
44+ } )
45+ }
46+
47+ async function handleGetCustomData ( ) {
48+ const view = fin . me as OpenFin . View
49+ const options = await view . getOptions ( ) ;
50+ console . log ( 'Custom Data' , options . customData ) ;
51+ }
52+
3653 return (
3754 < div className = "col fill gap20" >
3855 < header className = "row spread middle" >
@@ -52,6 +69,11 @@ function View2() {
5269 </ pre >
5370 </ fieldset >
5471 < button onClick = { ( ) => setMessage ( "" ) } > Clear</ button >
72+
73+ < hr />
74+
75+ < button onClick = { handleSaveCustomData } > Save Page custom data</ button >
76+ < button onClick = { handleGetCustomData } > Get Page custom data</ button >
5577 </ main >
5678 </ div >
5779 ) ;
You can’t perform that action at this time.
0 commit comments