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
npm install jquery --save |
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 CONSTANTS from '../constants'; | |
export let actionCreditar = (valorCredito) => { | |
return { | |
type: CONSTANTS.CREDITO, | |
payload: { | |
valor: valorCredito | |
} | |
}; | |
}; |
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 CONSTANTS from '../constants/'; | |
const initialState = { | |
saldo: 0, | |
valorTransacao: 0, | |
erro: "" | |
}; | |
let reducerConta = (state = initialState, action) => { | |
switch (action.type) { |
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 { createStore, applyMiddleware } from 'redux'; | |
//importa os middlewares | |
import logger from 'redux-logger'; | |
import thunk from 'redux-thunk'; | |
//importa os reducers | |
import rootReducers from './reducers'; | |
//cria a store passando os reducers e os middlewares | |
let store = createStore( | |
rootReducers, |
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
//exemplo estrutura de um middleware | |
export let middlewareExemplo = ({ getState, dispatch }) => next => action => { | |
//.next() passa a action para os proximos middlewares | |
//ate chegar nos reducers que atualizam o state | |
let result = next(action); | |
//retorna o retorno da execucao dos middlewares seguintes | |
//ou action caso seja o ultimo middleware em execucao | |
return result; | |
}; |
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
# Configuration file for varnish | |
# | |
# /etc/init.d/varnish expects the variable $DAEMON_OPTS to be set from this | |
# shell script fragment. | |
# | |
# Maximum number of open files (for ulimit -n) | |
NFILES=131072 | |
# Locked shared memory (for ulimit -l) |
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
downloadArquivo("./video.ogv", function(progresso, total, perc) { | |
document.querySelector("progress").value = perc; | |
}).then(function(arrayBuffer) { | |
//cria um Blob a partir do arrayBuffer | |
var blob = new Blob([arrayBuffer], { | |
type: "video/ogg" | |
}); | |
//cria o elemento video | |
var video = document.createElement("video"); | |
video.autoplay = true; |
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
//para modulos default | |
import variavelDefault from "./exemplo.js"; | |
//para modulos default que também possuem outros exports | |
import variavelDefault, { variavelNaoDefault } from "./exemplo.js"; | |
//renomeando a default | |
import { default as variavelDefault, variavelNaoDefault } from "./exemplo.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
export default function(a, b){ | |
return a+b; | |
} | |
//ou | |
function soma(a, b){ | |
return a + b; | |
} | |
export default soma; |
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
//importando apenas um identificador | |
import {algumaCoisa} from "./modulo-teste.js"; | |
//importando apenas um identificador e renomeando | |
import {algumaCoisa as teste} from "./modulo-teste.js"; | |
//importando vários identificadores | |
import {algumaCoisa, Pokemon, soma} from "./modulo-teste.js" | |
//importando o modulo inteiro |
NewerOlder