Skip to content

Function: view()

view<T>(): <S>(select) => View<T, S>

Defined in: packages/fate/src/view.ts:105

Creates a reusable view for an object using the declared selection.

Type Parameters

T

T extends Entity

Returns

<S>(select): View<T, S>

Type Parameters

S

S extends Selection<T>

Parameters

select

S & SelectionValidation<T, S>

Returns

View<T, S>

Example

ts
const PostView = view<Post>()({
  id: true,
  title: true,
});

Released under the MIT License