Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1846

Switch path unexpected on optional record with optional fields

$
0
0

For sure:

type choice<'id> = {
  label: string,
  id: 'id,
}

type getCompareValue<'item, 'compareValue> = 'item => 'compareValue

module FilterTypes = {
  type settings<'item, 'compareValue, 'id> = {
    getCompareValue: getCompareValue<'item, 'compareValue>,
    initialValue?: option<choice<'id>>,
    choices: array<choice<'id>>,
    defaultLabel?: option<string>,
  }

  type getCompareValue<'item, 'compareValue> = getCompareValue<'item, 'compareValue>

  type hookValue<'item, 'compareValue, 'id> = {
    reset: unit => unit,
    selected: option<choice<'id>>,
    component: React.element,
    settings: option<settings<'item, 'compareValue, 'id>>,
  }
}

Viewing all articles
Browse latest Browse all 1846

Trending Articles