realar-project / realar

5 kB Advanced state manager for React
MIT License
44 stars 0 forks source link

low: signal.from.select broken ts types #82

Closed betula closed 3 years ago

betula commented 3 years ago
signal
  .from(() => {
    return [
      buyAnnualLocale.val,
      sharedPurchases().annual_subscription.val
    ]
  })
  .select(([locale, sub]) => { // both variables have one type "string | Subscription | undefined"
    if (!sub) return void 0;
    const localized_price = (sub as any)?.localizedPrice;
    if (!localized_price) return void 0;

    return locale.text
  })
betula commented 3 years ago

Moved to "the stream of conciseness 0.7+ roadmap"