Skip to content

Commit e8b32a3

Browse files
committed
Add example for constructor.
1 parent cbb2ae3 commit e8b32a3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/provider/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,16 @@ export class Provider {
3939
public publishAppointments = publishAppointments
4040
public getAppointments = getAppointments
4141

42+
// this will be replaced by persistent storage
4243
private _loggedOut: boolean
4344
private _openAppointments: Array<Appointment>
45+
private _id: string
46+
47+
constructor(id: string){
48+
// the ID will be used to address local storage so that e.g. we can
49+
// manage multiple providers, users etc. if necessary...
50+
this._id = id
51+
}
4452

4553
public get openAppointments(): Array<Appointment> {
4654
return this._openAppointments

0 commit comments

Comments
 (0)