Skip to content

Function: view() ​

view<T>(): {<P, S>(select): ParameterizedView<T, P, MutableSelection<T, S>>; <S>(select): View<T, MutableSelection<T, S>>; }

Defined in: fate/src/view.ts:151

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

Type Parameters ​

T ​

T extends Entity

Returns ​

{<P, S>(select): ParameterizedView<T, P, MutableSelection<T, S>>; <S>(select): View<T, MutableSelection<T, S>>; }

Example ​

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

Released under the MIT License