-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cookbook-react-bookmark): Update cookbook to use new bookmark mo…
…dule
- Loading branch information
Showing
3 changed files
with
43 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
'@equinor/fusion-framework-cookbook-app-react-bookmark': minor | ||
--- | ||
|
||
Updated Bookmark Handling in App Component | ||
|
||
- Refactored `App.tsx` to use `useLayoutEffect` instead of `useEffect` for synchronizing the `payload` state with the current bookmark. | ||
- Replaced `useState` and `useCallback` with `useRef` for managing the `updateData` reference. | ||
- Simplified state management by removing `BookmarkState` and `init` and directly using `payload` state. | ||
- Updated input change handlers to directly update the `payload` state instead of using `updateState`. | ||
|
||
Configuration Changes | ||
|
||
- Updated `config.ts` to enable the bookmark module using `enableBookmark`. | ||
- Removed unnecessary logger level settings and configuration callbacks for a cleaner setup. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,13 @@ | ||
import type { AppModuleInitiator } from '@equinor/fusion-framework-react-app'; | ||
|
||
import { enableContext } from '@equinor/fusion-framework-module-context'; | ||
import { enableBookmark } from '@equinor/fusion-framework-react-app/bookmark'; | ||
|
||
export const configure: AppModuleInitiator = (configurator) => { | ||
enableContext(configurator, async (builder) => { | ||
builder.setContextType(['projectMaster']); // set contextType to match against | ||
}); | ||
configurator.logger.level = 0; | ||
|
||
/** callback when configurations is created */ | ||
configurator.onConfigured((config) => { | ||
console.log('application config created', config); | ||
}); | ||
|
||
/** callback when the application modules has initialized */ | ||
configurator.onInitialized((instance) => { | ||
console.log('application config initialized', instance); | ||
}); | ||
enableBookmark(configurator); | ||
}; | ||
|
||
export default configure; |