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
| export default { | |
| setImage(state, image) { | |
| Vue.set(state, 'images', image); | |
| }, | |
| }; |
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 getters from './getters' | |
| import actions from './actions' | |
| import mutations from './mutations' | |
| const state = { | |
| images: [], | |
| status: null, | |
| }; | |
| const namespaced = true; |
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 Vue from 'vue'; | |
| import Vuex from 'vuex'; | |
| import {images} from './modules/images'; | |
| Vue.use(Vuex); | |
| export const store = new Vuex.Store({ | |
| modules: { | |
| images, | |
| } |
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
| Object.is(NaN, NaN); //true |
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
| NaN === NaN //false |
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
| ' ' == 0 //true | |
| null == undefined //true | |
| [1] == true //true |
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
| if (!Object.is) { | |
| Object.is = function(x, y) { | |
| // SameValue algorithm | |
| if (x === y) { // Steps 1-5, 7-10 | |
| // Steps 6.b-6.e: +0 != -0 | |
| return x !== 0 || 1 / x === 1 / y; | |
| } else { | |
| // Step 6.a: NaN == NaN | |
| return x !== x && y !== y; | |
| } |
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
| ['Hängt', 'Haut', 'Hüllen', 'Hubert'].sort(Intl.Collator().compare); | |
| //["Hängt", "Haut", "Hubert", "Hüllen"] Good |
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
| ['Hängt', 'Haut', 'Hüllen', 'Hubert'].sort(function (a, b) { | |
| return a.localeCompare(b); | |
| }); | |
| //["Hängt", "Haut", "Hubert", "Hüllen"] Good |
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
| ['Hängt', 'Haut', 'Hüllen', 'Hubert'].sort(); | |
| // ["Haut", "Hubert", "Hängt", "Hüllen"] Bad |
NewerOlder