<!--
This file was generated by Spark. Do not edit it by hand.
-->
# Ash.Signals



## signals
Declare signals that resources can emit and listen to.

### Nested DSLs
 * [signal](#signals-signal)
   * argument


### Examples
```
signals do
  signal :post_created do
    argument :post_id, :uuid, allow_nil?: false
  end
end

```




### signals.signal
```elixir
signal name
```


Declares a signal, and defines a struct for its arguments.

For a signal named `:post_created` in `MyApp.Signals`, this is `MyApp.Signals.PostCreated`.


### Nested DSLs
 * [argument](#signals-signal-argument)


### Examples
```
signal :post_created do
  argument :post_id, :uuid, allow_nil?: false
end

```



### Arguments

| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#signals-signal-name){: #signals-signal-name .spark-required} | `atom` |  | The name of the signal. |
### Options

| Name | Type | Default | Docs |
|------|------|---------|------|
| [`phase`](#signals-signal-phase){: #signals-signal-phase } | `:before_action \| :after_action \| :after_transaction` | `:after_action` | The phase of the emitting action during which the signal may be emitted. |
| [`description`](#signals-signal-description){: #signals-signal-description } | `String.t` |  | A description of the signal. |


### signals.signal.argument
```elixir
argument name, type
```


An argument of the signal, provided by the emitter.



### Examples
```
argument :post_id, :uuid, allow_nil?: false
```



### Arguments

| Name | Type | Default | Docs |
|------|------|---------|------|
| [`name`](#signals-signal-argument-name){: #signals-signal-argument-name .spark-required} | `atom` |  | The name of the field. |
| [`type`](#signals-signal-argument-type){: #signals-signal-argument-type .spark-required} | `module` |  | The type of the field. |
### Options

| Name | Type | Default | Docs |
|------|------|---------|------|
| [`constraints`](#signals-signal-argument-constraints){: #signals-signal-argument-constraints } | `keyword` | `[]` | Constraints for the type. |
| [`allow_nil?`](#signals-signal-argument-allow_nil?){: #signals-signal-argument-allow_nil? } | `boolean` | `true` | Whether the field may be `nil`. |
| [`default`](#signals-signal-argument-default){: #signals-signal-argument-default } | `any` |  | A default value for the field. |
| [`description`](#signals-signal-argument-description){: #signals-signal-argument-description } | `String.t` |  | A description of the field. |





### Introspection

Target: `Ash.Signals.Field`




### Introspection

Target: `Ash.Signals.Signal`





<style type="text/css">.spark-required::after { content: "*"; color: red !important; }</style>
