ngneat/falso

Entity functions

Closed this issue · 0 comments

Description

Most of the demos need predefined entities to work it.

Proposed solution

Create new entity functions under the Entities category.

  • todo
import { fake, FakeOptions } from './core/core';

/**
 * Generate a random todo.
 *
 * @category Entities
 *
 * @example
 *
 * randTodo()
 *
 * @example
 *
 * randTodo({ length: 10 })
 *
 */
export function randTodo<O extends FakeOptions>(options?: O) {
  return fake(() => ({
     id,
     title,
     completed: false
  }), options);
}
  • user
  • post
  • comment

Alternatives considered

No response

Do you want to create a pull request?

No