ash/lib/ash/registry/registry.ex
Zach Daniel 04744f395f improvement: move functions to more conventional places
improvement: move ash.formatter task to `spark.formatter`
2022-08-28 19:27:44 -06:00

31 lines
894 B
Elixir

defmodule Ash.Registry do
@moduledoc """
A registry allows you to separate your resources from your `api` module, to reduce improve compile times and reduce compile time dependencies.
For example:
```elixir
defmodule MyApp.MyRegistry do
use Ash.Registry,
extensions: [Ash.Registry.ResourceValidations]
# This extension adds some simple validations, for example that
# all related resources are also present in this registry.
entries do
entry MyApp.Resource
entry MyApp.OtherResource
end
end
```
"""
@type t :: module
use Spark.Dsl, default_extensions: [extensions: [Ash.Registry.Dsl]]
@deprecated "use Ash.Registry.Info.warn_on_empty?/1 instead"
defdelegate warn_on_empty?(registry), to: Ash.Registry.Info
@deprecated "use Ash.Registry.Info.entries/1 instead"
defdelegate entries(registry), to: Ash.Registry.Info
end