Skip to content

Commit

Permalink
fix(doc): typescript generic argument for service
Browse files Browse the repository at this point in the history
  • Loading branch information
BobrImperator committed Dec 30, 2024
1 parent 035c7c4 commit a143de4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ type Data = {
}
}

export default class SessionService<Data> extends Service {}
export default class SessionService extends Service<Data> {}
```

then __the session service can be injected wherever
Expand Down
15 changes: 15 additions & 0 deletions guides/upgrade-to-v7.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@ import AdaptiveStore from 'ember-simple-auth/session-stores/adaptive';
export default class SessionStore extends AdaptiveStore {}
```

**Typescript: Optional Generic `Data` argument.**

```ts
import Service from 'ember-simple-auth/services/session';

type Data = {
authenticated: {
// Any data your authenticators return
id: string;
}
}

export default class SessionService extends Service<Data> {}
```

## Removed RSVP

Async APIs were built on top of RSVP.Promise, we're no longer relying on it and use the native Promise instead.
Expand Down

0 comments on commit a143de4

Please sign in to comment.