Reseting Vuex module to its original state could be tideous if you have to manually reset all values. So instead you could use a function to retrieve the default state.
const getDefaultState = () => {
return {
id: '',
authors: []
}
}
Reseting Vuex module to its original state could be tideous if you have to manually reset all values. So instead you could use a function to retrieve the default state.
const getDefaultState = () => {
return {
id: '',
authors: []
}
}
Vuex can be quite repetitive to write generic mutations (arrays : set
, add
, update
, delete
, literals: update
) for each state property. But it's important to keep track of changes inside the store.
So here's a way to generate generic mutations and associated actions :
// book-store.js
const state = {
id: '',
title: '',
authors: [],
Math.random().toString(36).slice(-10); |
function nextStep(cb, ...args) { | |
setTimeout(() => { | |
cb(...args) | |
}, 1000) | |
} | |
function step1(foo){ | |
// some logic and pass result to next step | |
var bar = foo * 2 | |
nextStep(step2, foo, bar) |
javascript:(function(){
var base_url = window.location.href.replace('studio.fun-mooc.fr/course','fun-mooc.fr/courses')+'/jump_to_id/';
var sections = $('.outline-section');
var sectionList = $('<ul/>');
This is a known bug in gnome (ubuntu 18.04) : https://wiki.ubuntu.com/DebuggingScreenLocking#line-184
/etc/shadow
permissions# example
$ ls -l /etc/shadow
-r-------- 1 root root 1695 sept. 4 11:37 /etc/shadow
# should be
name: mooc_rr | |
channels: | |
- conda-forge | |
- defaults | |
dependencies: | |
- alembic=0.9.9 | |
- attrs=18.1.0 | |
- automat=0.7.0 | |
- backcall=0.1.0 | |
- beautifulsoup4=4.6.0 |
Regex : /^(\d{2}:\d{2}:\d{2}[.,]\d{3})\s-->\s(\d{2}:\d{2}:\d{2}[.,]\d{3})\n(.*(?:\r?\n(?!\r?\n).*)*)/gm
Demo : https://regex101.com/r/TH1JhU/1
Code example :
const regex = /^(\d{2}:\d{2}:\d{2}[.,]\d{3})\s-->\s(\d{2}:\d{2}:\d{2}[.,]\d{3})\n(.*(?:\r?\n(?!\r?\n).*)*)/gm;
const str = `WEBVTT
00:00:00.000 --> 00:00:04.469
Blah Bla bla 1
Multine