-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#8] added mobx & user saved in mobx store
- Loading branch information
Pavlo Kyrylenko
committed
Nov 23, 2020
1 parent
3c1fa85
commit a40ae75
Showing
8 changed files
with
1,627 additions
and
16,555 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
import { observable, configure } from 'mobx'; | ||
|
||
configure({enforceActions: 'observed'}); | ||
|
||
const authStore = observable({ | ||
user: null, | ||
|
||
setUser(u?: any) { | ||
this.user = u | ||
}, | ||
}); | ||
|
||
export default authStore; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { get } from './crud'; | ||
|
||
const baseUrl = '/api/v1/auth'; | ||
|
||
async function getMe(): Promise<any> { | ||
return await get(`${baseUrl}`); | ||
}; | ||
|
||
export default { | ||
getMe: getMe, | ||
} |
Oops, something went wrong.