Skip to content

Commit

Permalink
Add more detail to README
Browse files Browse the repository at this point in the history
  • Loading branch information
markburns authored Dec 26, 2023
1 parent e748a1b commit 818a9c9
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ However, sometimes in complex interactor chains, the complex debugging happens a

Interactify wraps the interactor and interactor-contract gem and provides additional functionality making chaining and understanding interactor chains easier.

This is a bells and whistles gem and assumes you are working in a Rails project with Sidekiq.
However, I'm open to the idea of making it more focused and making these more pluggable.

### Syntactic Sugar
- Everything is an Organizer/Interactor and supports interactor-contracts.
- Concise syntax for most common scenarios with `expects` and `promises`. Verifying the presence of the keys/values.
- Automatic delegation of expected and promised keys to the context.

```ruby
# before
Expand All @@ -16,6 +22,8 @@ class LoadOrder

expects do
required(:id).filled
required(:something_else).filled
required(:a_boolean_flag)
end

promises do
Expand All @@ -35,7 +43,8 @@ end
class LoadOrder
include Interactify

expect :id
expect :id, :something_else
expect :a_boolean_flag, filled: false
promise :order

def call
Expand Down Expand Up @@ -63,7 +72,7 @@ organize \

Sometimes we want an interactor for each item in a collection.
But it gets unwieldy.
It was complex procedural code and is now broken into neat SRP classes (Single Responsibility Principle).
It was complex procedural code and is now broken into neat [SRP classes](https://en.wikipedia.org/wiki/Single_responsibility_principle).
But there is still boilerplate and jumping around between files to follow the orchestration.
It's easy to get lost in the orchestration code that occurs across say 7 or 8 files.

Expand Down

0 comments on commit 818a9c9

Please sign in to comment.