main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
572 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
3 | var defaultMapPropsToArgs = function (props) { return [props]; };
|
---|
4 | function createRenderProp(hook, mapPropsToArgs) {
|
---|
5 | if (mapPropsToArgs === void 0) { mapPropsToArgs = defaultMapPropsToArgs; }
|
---|
6 | return function RenderProp(props) {
|
---|
7 | var state = hook.apply(void 0, mapPropsToArgs(props));
|
---|
8 | var children = props.children, _a = props.render, render = _a === void 0 ? children : _a;
|
---|
9 | return render ? render(state) || null : null;
|
---|
10 | };
|
---|
11 | }
|
---|
12 | exports.default = createRenderProp;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.