Skip to content

Enhance Repository Mixin to provide a repository getter  #745

@bajtos

Description

@bajtos

Example usage:

// app setup
app.repository(TodoRepository);

// in place where we need to access the repo directly
const todoRepo = await app.getRepository<TodoRepository>(TodoRepository.name);

// if TS supports this pattern, then the following would provide even better UX:
const todoRepo = await app.getRepository(TodoRepository);

Loosely related: #744

Acceptance Criteria

  • Create the getter function
  • Add TSDocs
  • Update examples to use this new approach instead of ctx.get
  • Update loopback.io documents

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions