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
import baseApi from './api'; | |
import { displayUserFeedback } from './utils'; | |
export async function handleClickGetAllUsers() { | |
try { | |
return await baseApi.users.getAll(); | |
} catch () { | |
displayUserFeedback('There was an error retrieving the users.'); | |
} | |
} |
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
import ApiCore from 'axios-core-api'; | |
import axiosConfig from './axiosConfig.js'; | |
import UsersApi from './UsersApi'; | |
class BaseApi { | |
constructor(apiCore, basePath) { | |
this._apiCore = apiCore; | |
this._basePath = basePath; | |
this.users = new UsersApi(this._apiCore, this._basePath); |
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
export default class UsersApi { | |
constructor(apiCore, basePath) { | |
this._apiCore = apiCore; | |
this._basePath = `${basePath}/users`; | |
} | |
getAll() { | |
return this._apiCore.get(this._basePath); | |
} | |
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
import ApiCore from 'axios-core-api'; | |
import axiosConfig from './axiosConfig.js'; | |
class BaseApi { | |
constructor(apiCore, basePath) { | |
this._apiCore = apiCore; | |
this._basePath = basePath; | |
} | |
} |
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
import ApiCore from 'axios-core-api'; | |
import axiosConfig from './axiosConfig.js'; | |
class BaseApi { | |
constructor(apiCore) { | |
this._apiCore = apiCore; | |
} | |
} | |
const apiCore = new ApiCore(axiosConfig); |
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
export default { | |
headers: { | |
Accept: 'application/json', | |
'Content-Type': 'application/json' | |
}, | |
timeout: 15000 | |
}; |
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
import ApiCore from 'axios-core-api'; | |
class BaseApi { | |
constructor(apiCore) { | |
this._apiCore = apiCore; | |
} | |
} | |
const apiCore = new ApiCore(); | |
const baseApi = new BaseApi(apiCore); |
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
import axios from 'axios'; | |
import { displayUserFeedback } from './utils'; | |
const axiosConfig = { | |
headers: { | |
Accept: 'application/json', | |
'Content-Type': 'application/json' | |
}, | |
timeout: 15000 | |
}; |
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
import axios from 'axios'; | |
import { displayUserFeedback } from './utils'; | |
export function handleClickGetAllUsers() { | |
axios.get('https://www.example.org/api/users', { | |
headers: { | |
Accept: 'application/json', | |
'Content-Type': 'application/json' | |
}, | |
timeout: 15000 |
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
// example 1: @include slide(up, 125ms, 100%); | |
// example 2: No distance required for "off" @include slide(off, 125ms); | |
// example 3: | |
// div { | |
// @include slide(up, 250ms, 100%); | |
// | |
// &.is-visible { | |
// @include slide(off, 125ms); | |
// } |
NewerOlder