Created
February 11, 2018 20:24
-
-
Save wanxe/3a2d8095bc6237e921cd7209cd4ac5b0 to your computer and use it in GitHub Desktop.
Simple Repository Pattern
This file contains hidden or 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 Repository from './SomeAjaLibrary' // Axios, jQuery, fetch.... | |
export default { | |
get () { | |
return Repository.get('/api/products') | |
}, | |
create (payload) { | |
return Repository.post('/api/products', payload) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment