From 04572a8e5081b1e4871e273cde9dbaaa44c52fe0 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Wed, 13 Mar 2024 21:43:44 +0000 Subject: structure: Create apps dir and copy tooling dir from t3-turbo repo --- apps/mobile/lib/last-shared-intent.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 apps/mobile/lib/last-shared-intent.ts (limited to 'apps/mobile/lib/last-shared-intent.ts') diff --git a/apps/mobile/lib/last-shared-intent.ts b/apps/mobile/lib/last-shared-intent.ts new file mode 100644 index 00000000..951bcf74 --- /dev/null +++ b/apps/mobile/lib/last-shared-intent.ts @@ -0,0 +1,15 @@ +import { create } from "zustand"; + +interface LastSharedIntent { + lastIntent: string; + setIntent: (intent: string) => void; + isPreviouslyShared: (intent: string) => boolean; +} + +export const useLastSharedIntent = create((set, get) => ({ + lastIntent: "", + setIntent: (intent: string) => set({ lastIntent: intent }), + isPreviouslyShared: (intent: string) => { + return get().lastIntent === intent; + }, +})); -- cgit v1.2.3-70-g09d2