Skip to content

Commit

Permalink
chore: Add service vs context doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Exelord committed Jun 3, 2024
1 parent a6a7a33 commit ec64622
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export default function LogoutComponent() {
}
```

### How does services differ from using just a context?

Solid Services is built on top of the Solid.js context API, but it provides the opposite of how context works. While context gives you access to the closest data provider, Solid Services gives you access to the furthest available provider. This means you opt-in to use a "global" shared service, instead of nearest encapsulated provider, while maintaining full access control of downstream data.

## Service Registry

The `ServiceRegistry` is a component that creates a context around the components within an application, allowing developers to scope the services to specific parts of the application.
Expand Down

0 comments on commit ec64622

Please sign in to comment.