- It adds defaults to models if the schema has them, but does not remove invalid fields from
.toJSON
when pulling them out of Mongo- But it does remove it for the model object
.inspect
reflects the.toJSON
version, so debugging is basically impossible
- Can't use object spread with a model to get a new version of it
- There's no way to have
.update
update the model in-place - I mean I don't want it to be the default, but having the option would be nice
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
ERROR in ./src/containers/index.js | |
Module build failed: SyntaxError: /home/ben/calico/src/containers/index.js: Unexpected token (1:7) | |
> 1 | export App from './App/App'; | |
| ^ | |
2 | export Chat from './Chat/Chat'; | |
3 | export Home from './Home/Home'; | |
4 | export Widgets from './Widgets/Widgets'; | |
at Parser.pp.raise (/home/ben/calico/node_modules/babylon/lib/parser/location.js:24:13) | |
at Parser.pp.unexpected (/home/ben/calico/node_modules/babylon/lib/parser/util.js:82:8) | |
at Parser.pp.expect (/home/ben/calico/node_modules/babylon/lib/parser/util.js:76:33) |
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
thr = Thread.new do | |
started = false | |
finished = false | |
def cleanup | |
puts '...started cleaning resource' unless started | |
started = true | |
sleep 1 | |
puts '...finished cleaning resource' unless finished | |
finished = 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
const hi = async () => 5; | |
hi().then(num => console.log(num)); // results in 5... eventually |
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
render() { | |
const style = this.getStyles().position ? | |
this.getStyles() : | |
absolutePositionStyles(this.props.getCard(), this.getStyles()); | |
const classes = ['bubble']; | |
if (!this.state.static) { | |
classes.push('is-animating'); | |
} |
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
class OpenArticle extends Component { | |
static propTypes = { | |
article: PropTypes.article.isRequired, | |
getCard: PropTypes.func.isRequired, | |
openArticle: PropTypes.oneOfType([PropTypes.bool, PropTypes.article]).isRequired, | |
}; | |
shouldComponentUpdate(newProps) { | |
const oldOpenSlug = this.props.openArticle && this.props.openArticle.slug; | |
const newOpenSlug = newProps.openArticle && newProps.openArticle.slug; |
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 retrieved = { | |
"instant_articles_insights": { | |
"data": [ | |
{ | |
"time": "2016-03-16T08:00:00+0000", | |
"value": "1" | |
}, | |
{ | |
"time": "2016-03-17T08:00:00+0000", | |
"value": "63" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script async src="http://cdn.taboola.com/libtrc/aplus/loader.js"> | |
</script> | |
<script> | |
var inDapIF=true; | |
</script> | |
<style type="text/css"> |
- Actually reasonable Mongo driver (with pluggable schema validators)
- Reasonable Mongo schema validator
- Nestable routes for
zeit/micro
- Nice test suite ergonomics
- Ava actually does a much better job than Mocha or Jest here
- Want context variables (like in Ava)
- Want chainable middleware
context
anddescribe
(each can mutate context variables and have their own lifecycle hooks (beforeEach
,before
, etc.)
- Babel plugin to transform arrow function class properties to be implemented using
prototype
andbind
rather than making the function in the constructor - Doing a
bind
is cheaper than creating the whole function every time!
OlderNewer