Skip to content

Commit 159233e

Browse files
committed
doc: generic argument for service
1 parent 432edcc commit 159233e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,21 @@ import AdaptiveStore from 'ember-simple-auth/session-stores/adaptive';
151151
export default class SessionStore extends AdaptiveStore {}
152152
```
153153

154+
#### Optional Generic `Data` argument.
155+
156+
```ts
157+
import Service from 'ember-simple-auth/services/session';
158+
159+
type Data = {
160+
authenticated: {
161+
// Any data your authenticators return
162+
id: string;
163+
}
164+
}
165+
166+
export default class SessionService<Data> extends Service {}
167+
```
168+
154169
then __the session service can be injected wherever
155170
needed in the application__. In order to display login/logout buttons depending
156171
on the current session state, inject the service into the respective controller

0 commit comments

Comments
 (0)