Originate / recouple

Declarative and type-safe API bridging. Write full-stack applications with ease.
MIT License
4 stars 1 forks source link

Design and implement an ergonomic surface syntax #11

Closed sleexyz closed 6 years ago

sleexyz commented 6 years ago

The current internal representation is not very ergonomic at all. For example:

const endpoint: SafeAPI.Endpoint<{ id: string }, Foo> = new SafeAPI.Snoc({
  previous: new SafeAPI.Snoc({
    previous: new SafeAPI.Nil(),
    middleware: new SafeAPI.Fragment("/getFoo")
  }),
  middleware: new SafeAPI.QueryParams({ id: new StringRep() })
});

Users should have a more ergonomic representation that fulfills the following requirements: