Skip to content

Commit

Permalink
feat: add context instead of single contexts (#1163)
Browse files Browse the repository at this point in the history
* chore: add context instead of single contexts

* Create thirty-chicken-play.md
  • Loading branch information
julianiff authored Dec 5, 2024
1 parent 1d0a3d1 commit df6e41a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/thirty-chicken-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@frontify/app-bridge-app": patch
---

feat: add context instead of single contexts
4 changes: 2 additions & 2 deletions packages/app-bridge-app/src/react/appContext.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* (c) Copyright Frontify Ltd., all rights reserved. */

import { AppBridgePlatformApp, type AssetActionContext, type AssetCreationContext } from '../AppBridgePlatformApp.ts';
import { AppBridgePlatformApp, type PlatformAppContext } from '../AppBridgePlatformApp.ts';

/**
* This function just helps to get the Context
*/
export const appContext = <T extends AssetActionContext | AssetCreationContext>(): T => {
export const appContext = <T extends PlatformAppContext>(): T => {
const appBridge = new AppBridgePlatformApp();
return appBridge.context().get() as T;
};

0 comments on commit df6e41a

Please sign in to comment.