equinor / equinor/fusion-framework

Use useCurrentApp hook in AppLoader instead of manual observable wiring

Open
#5,087 0 comments 0 reactions 0 assignees View on GitHub
module:dev-portal tech-debt
Dominant language
TypeScript
Stars
10
Forks
10
Avg merge
19h 40m
Merged PRs (30d)
150

Description

## Context

`AppLoader` in [`packages/dev-portal/src/AppLoader.tsx`](https://github.com/equinor/fusion-framework/blob/main/packages/dev-portal/src/AppLoader.tsx) currently observes the current application via:

```ts
const { value: currentApp } = useObservableState(
useMemo(() => fusion.modules.app.current$, [fusion.modules.app]),
);
```

## Task

Change this to use a `useCurrentApp` hook (once available) instead of manually wiring `useObservableState` + `useMemo` around `fusion.modules.app.current$`.

## Acceptance criteria

- [ ] `useCurrentApp` hook exists (or is confirmed to already exist) and is adopted here
- [ ] Behavior unchanged (still re-renders when the current app changes)

Contributor guide

Open the contributing guide

Research direction

Start in packages/dev-portal/src/AppLoader.tsx and search the repository for an existing useCurrentApp hook. Confirm whether the hook exists or identify where it should come from, then verify that AppLoader still re-renders when fusion.modules.app.current$ changes. Done means AppLoader uses useCurrentApp and its behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.