Introduced Server Side Rendering for Cloud Pages based on React
This commit is contained in:
1 parent
569b849457
commit
1d6772eef3
17 files changed
+456
-61
No files matched your search
@@ -0,0 +1,36 @@
|
||||
function compose(...fns) {
|
||||
return value => [...fns]
|
||||
.reverse()
|
||||
.reduce((acc, fn) => fn(acc), value)
|
||||
}
|
||||
|
||||
/**
|
||||
* AND operator for list of values
|
||||
*
|
||||
* [true, true, true, ...] -> true
|
||||
* [false, true, true, ...] -> false
|
||||
*
|
||||
* @param list
|
||||
* @return {boolean}
|
||||
*/
|
||||
function all(list) {
|
||||
return list.reduce((t, i) => t && i, true)
|
||||
}
|
||||
|
||||
/**
|
||||
* OR operator for list of values
|
||||
*
|
||||
* [true, true, true, ...] -> true
|
||||
* [false, true, true, ...] -> true
|
||||
* [false, false, false, ...] -> false
|
||||
*
|
||||
* @param list
|
||||
* @return {boolean}
|
||||
*/
|
||||
function any(list) {
|
||||
return list.reduce((t, i) => t || i, false)
|
||||
}
|
||||
|
||||
exports.compose = compose
|
||||
exports.all = all
|
||||
exports.any = any
|
||||
Reference in new issue
Block a user