- promise-loader returns a promise
require("promise?bluebird!./file.js")(file => ...);
- bundle-loader returns a callback
require("bundle!./file.js")(file => ...);
Both are using require.ensure()
behind the scene.
Manually :
/** | |
* Handle records with a timestamp in their Avro value. | |
* Expects a LONG field named "timestamp". | |
* Any problem makes this extractor return the record's internal timestamp. | |
*/ | |
public class InValueTimestampExtractor implements TimestampExtractor { | |
@Override | |
public long extract(ConsumerRecord<Object, Object> record) { | |
if (record != null && record.value() != null) { |
require("promise?bluebird!./file.js")(file => ...);
require("bundle!./file.js")(file => ...);
Both are using require.ensure()
behind the scene.
Manually :
const daggy = require('daggy'); | |
const {foldMap} = require('pointfree-fantasy') | |
const {concat, toUpper, prop, identity, range, compose} = require('ramda'); | |
// Contravariant functors usually have this shape F(a -> ConcreteType). | |
// In other words, some type holding a function which is parametric on its input, but not output. | |
// They don't always have that shape, but it's a good intuition | |
// Covariant functors are what we're used to, which are parametric in their output | |
//================================================================ |