API Reference / @evolu/common / Evolu/Internal / updateable
Function: updateable()
function updateable<Props>(props): ValidMutationSize<UpdateableProps<Props>>;
Defined in: packages/common/src/Evolu/Schema.ts:356
Type Factory to create updateable Type. It makes everything except for
the id
column partial (i.e. optional) and ensures the
maxMutationSize.
Example
const UpdateableTodo = updateable(Schema.todo);
type UpdateableTodo = typeof UpdateableTodo.Type;
// `id` is required; all other fields are optional.
const todoResult = UpdateableTodo.from({
id: "123",
title: "New Title",
});
if (!todo.ok) return; // handle errors
Type Parameters
Type Parameter |
---|
Props extends Record <string , AnyType > |
Parameters
Parameter | Type |
---|---|
props | Props |
Returns
ValidMutationSize
<UpdateableProps
<Props
>>