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 interface Module<State> { | |
state(): State | |
} | |
export interface FooState { | |
foo: String | |
} | |
export default class AuthModule implements Module<FooState> { | |
state() { |
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 interface Module<State> { | |
state(): State | |
} | |
export interface FooState { | |
foo: String, | |
} | |
// No error | |
const correct: Module<FooState> = { |
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 interface Module<State> { | |
state: (() => State) | |
} | |
export interface FooState { | |
user: String | |
} | |
const module: Module<FooState> = { | |
state() { |
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 async ({ store, redirect, req }) => { | |
/** | |
* Unautheticated client handler. | |
*/ | |
const unauthenticated = () => redirect('/login') | |
/** | |
* Fetch the user from an API. | |
*/ | |
const fetch = async () => { |
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
/** | |
* First, we will load all of this project's Javascript utilities and other | |
* dependencies. Then, we will be ready to develop a robust and powerful | |
* application frontend using useful Laravel and JavaScript libraries. | |
*/ | |
import "./bootstrap" | |
import Vue from "vue" | |
import ExampleComponent from "./components/ExampleComponent.vue" | |
import router from "./router" |
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 Vue from "vue" | |
import Vuex, { StoreOptions } from "vuex" | |
import { RootState, Todo } from "../types/store"; | |
import axios from "axios" | |
Vue.use(Vuex) | |
export default new Vuex.Store({ | |
state: { | |
todos: [] |
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 interface RootState { | |
todos: Todo[] | |
} | |
export interface Todo { | |
done: boolean | |
name: string | |
} |
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
/** | |
* First, we will load all of this project's Javascript utilities and other | |
* dependencies. Then, we will be ready to develop a robust and powerful | |
* application frontend using useful Laravel and JavaScript libraries. | |
*/ | |
import "./bootstrap" | |
import Vue from "vue" | |
import ExampleComponent from "./components/ExampleComponent.vue" | |
import router from "./router" |
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 Vue from "vue" | |
import VueRouter from "vue-router" | |
import IndexPage from "./views/Index.vue" | |
Vue.use(VueRouter) | |
export default new VueRouter({ | |
mode: 'history', | |
routes: [ |
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
/** | |
* First, we will load all of this project's Javascript utilities and other | |
* dependencies. Then, we will be ready to develop a robust and powerful | |
* application frontend using useful Laravel and JavaScript libraries. | |
*/ | |
import "./bootstrap" | |
import Vue from "vue" | |
import ExampleComponent from "./components/ExampleComponent.vue" |
NewerOlder