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
constructor($ngRedux) { | |
'ngInject'; | |
this.$ngRedux = $ngRedux; | |
$ngRedux.connect(this.mapStateToThis, actions)(this); | |
} | |
mapStateToThis(state) { | |
return { | |
currentActive: state.listReducer.currentActive | |
}; |
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
goUpIndex() { | |
this.$ngRedux.dispatch({ type: GOUP}); | |
} | |
setElements(elements) { | |
this.$ngRedux.dispatch({ type: ELEMENTS, elements }); | |
} | |
goDownIndex() { | |
this.$ngRedux.dispatch({ type: GODOWN }); |
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
$ npm i fuse-operators |
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
// Data example | |
const mockData = [ | |
{ | |
"title": "Old Man's War", | |
"author": { | |
"firstName": "John", | |
"lastName": "Scalzi" | |
} | |
}, | |
{ |
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
const query = 'old man && scalzi'; | |
const result = fuseWithOperators(query, mockData); | |
// → [{"title": "Old Man's War", "author": {"firstName": "John", "lastName": "Scalzi"}}] |
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
const query = 'old man || artist'; | |
const result = fuseWithOperators(query, mockData); | |
// → [{"title": "Old Man's War", "author": {"firstName": "John", "lastName": "Scalzi"}}, {"title": "The Lock Artist", "author": {"firstName": "John", "lastName": "Hamilton"}}] |
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
const query = 'old man || the lock artist > scalzi'; | |
const result = fuseWithOperators(query, mockData); | |
// → [{"title": "Old Man's War", "author": {"firstName": "John", "lastName": "Scalzi"}}] |
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
// Get string path from some resource | |
getClass().getResource('Some name resource').getPath() | |
// Get the resource can be as stream | |
getClass().getResource('some resource') | |
// Print where is the resource folder inside .war package | |
getClass().getResource('').getPath() |
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
var commands = CommandConfig.default() | |
commands.useFluentCommands() | |
services.register(commands) |
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 FluentPostgreSQL | |
import Vapor | |
struct AddFieldMock: Migration { | |
typealias Database = PostgreSQLDatabase | |
static func prepare( on connection: PostgreSQLConnection ) -> Future<Void> { | |
return Database.update(Acronym.self, on: connection) { builder in | |
builder.field(for: \.someFIeld) | |
} |