Toolverse
All skills

sync-construction-async-property-ui-render-gate-pattern

by EpicenterHQ

Sync construction with async property pattern. Use when creating clients that need async initialization but must be exportable from modules and usable synchronously in UI components.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Category
Mobile
Views
2

About this skill

Sync construction with async property pattern. Use when creating clients that need async initialization but must be exportable from modules and usable synchronously in UI components.

How to use

  1. Zdefiniuj funkcję createClient(), która zwraca obiekt klienta synchronicznie, bez await. Funkcja powinna inicjować asynchroniczną pracę (np. połączenie z bazą, załadowanie z dysku) w tle, ale sama musi zakończyć się natychmiast.

  2. Dołącz do obiektu klienta właściwość whenSynced (lub podobną), która przechowuje Promise reprezentujący zakończenie inicjalizacji asynchronicznej. Ta właściwość będzie możliwa do oczekiwania, gdy będzie to potrzebne.

  3. Eksportuj klienta bezpośrednio z modułu: export const client = createClient(). Nie używaj top-level await ani getter functions — klient jest dostępny natychmiast po imporcie.

  4. W komponentach UI importuj klienta normalnie i używaj jego metod synchronicznie: client.save(data), client.load(id). Metody działają od razu, bez czekania na inicjalizację.

  5. Gdy musisz zagwarantować, że inicjalizacja asynchroniczna jest ukończona (np. przed renderowaniem krytycznych danych), użyj await client.whenSynced w odpowiednim miejscu — w funkcji setup komponentu, route guardzie lub effect hook.

  6. W SvelteKit możesz użyć tego wzorca do warunkowego renderowania: czekaj na whenSynced w +page.js lub +layout.js, aby zagwarantować gotowość klienta przed renderowaniem strony.

Related skills

flutter-development

by aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

Mobile
1,1601,122

liquid-glass-developer

by anyproto

Context-aware routing to iOS 26 Liquid Glass implementation patterns. Use when working with glass effects, GlassEffectContainer, morphing transitions, or iOS 26 visual effects.

Mobile
2061

swift-best-practices

by sammcj

This skill should be used when writing or reviewing Swift code for iOS or macOS projects. Apply modern Swift 6+ best practices, concurrency patterns, API design guidelines, and migration strategies. Covers async/await, actors, MainActor, Sendable, typed throws, and Swift 6

Mobile
36140

vercel-react-native-skills

by vercel-labs

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or

Mobile
1745

mobile-ios-design

by wshobson

Master iOS Human Interface Guidelines and SwiftUI patterns for building native iOS apps. Use when designing iOS interfaces, implementing SwiftUI views, or ensuring apps follow Apple's design principles.

Mobile
107284

create-plan

by antinomyhq

Generate detailed implementation plans for complex tasks. Creates comprehensive strategic plans in Markdown format with objectives, step-by-step implementation tasks using checkbox format, verification criteria, risk assessments, and alternative approaches. Use when users need

Mobile
13108