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
/** | |
* Basic example of routerless store based routing. | |
* To understand what is going on check out | |
* https://svelte.dev/tutorial/writable-stores | |
* https://www.npmjs.com/package/feather-route-matcher | |
*/ | |
// stores.js |
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
// @flow | |
export const UPDATE_USER = 'UPDATE_USER' | |
export const updateUser = (payload: Object) => ({ | |
type: UPDATE_USER, | |
payload | |
}) |
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
function sum(numbers) { | |
return loop(0, numbers); | |
function loop(total, numbers) { | |
if (numbers.length === 0) { | |
return total; | |
} | |
let [head, ...tail] = numbers; | |
return loop(head + total, tail); |
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
javascript: (function() { | |
var interval = 1000; | |
var users = ['username']; | |
setInterval(function() { | |
users.forEach(function(user) { | |
var messages = document.querySelectorAll('li.message[data-name="' + user + '"]'); |
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
anon true, if the space may be omitted in anonymous function declarations | |
bitwise true, if bitwise operators should be allowed | |
browser true, if the standard browser globals should be predefined | |
cap true, if upper case HTML should be allowed | |
continue true, if the continuation statement should be tolerated | |
css true, if CSS workarounds should be tolerated | |
debug true, if debugger statements should be allowed | |
devel true, if logging should be allowed (console, alert, etc.) | |
eqeq true, if == should be allowed | |
es5 true, if ES5 syntax should be allowed |