@tivio/sdk-react 2.1.4 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/README.md +8 -0
  2. package/coverage/clover.xml +356 -95
  3. package/coverage/lcov-report/index.html +55 -25
  4. package/coverage/lcov-report/src/components/ContextProvider.tsx.html +194 -0
  5. package/coverage/lcov-report/src/components/TivioProvider.tsx.html +109 -37
  6. package/coverage/lcov-report/src/components/TivioWidgetError.tsx.html +3 -3
  7. package/coverage/lcov-report/src/components/TivioWidgetLoader.tsx.html +3 -3
  8. package/coverage/lcov-report/src/components/context/ChannelsContext.tsx.html +197 -0
  9. package/coverage/lcov-report/src/components/context/OrganizationSubscriptionsContext.tsx.html +179 -0
  10. package/coverage/lcov-report/src/components/context/PurchasesWithVideosContext.tsx.html +179 -0
  11. package/coverage/lcov-report/src/components/context/RowItemsContext.tsx.html +191 -0
  12. package/coverage/lcov-report/src/components/context/ScreensContext.tsx.html +185 -0
  13. package/coverage/lcov-report/src/components/context/SectionsContext.tsx.html +200 -0
  14. package/coverage/lcov-report/src/components/context/UserContext.tsx.html +176 -0
  15. package/coverage/lcov-report/src/components/context/VideosContext.tsx.html +200 -0
  16. package/coverage/lcov-report/src/components/context/index.html +231 -0
  17. package/coverage/lcov-report/src/components/context/index.ts.html +104 -0
  18. package/coverage/lcov-report/src/components/index.html +32 -32
  19. package/coverage/lcov-report/src/conf.ts.html +27 -21
  20. package/coverage/lcov-report/src/index.html +21 -6
  21. package/coverage/lcov-report/src/services/bundleLoader.ts.html +127 -157
  22. package/coverage/lcov-report/src/services/dependencyResolver.ts.html +36 -30
  23. package/coverage/lcov-report/src/services/index.html +102 -42
  24. package/coverage/lcov-report/src/services/logger.ts.html +53 -98
  25. package/coverage/lcov-report/src/services/packageLoader.ts.html +31 -31
  26. package/coverage/lcov-report/src/services/pubSub.ts.html +9 -9
  27. package/coverage/lcov-report/src/services/sentry.ts.html +170 -0
  28. package/coverage/lcov-report/src/services/settings.ts.html +34 -34
  29. package/coverage/lcov-report/src/setupTests.ts.html +9 -9
  30. package/coverage/lcov.info +641 -141
  31. package/dist/components/TivioProvider.d.ts +3 -0
  32. package/dist/components/hooks/usePurchaseSubscription.d.ts +2 -7
  33. package/dist/components/hooks/useTransactionPayment.d.ts +2 -7
  34. package/dist/conf.d.ts +1 -0
  35. package/dist/index.js +1 -2
  36. package/dist/services/dependencyResolver.d.ts +2 -1
  37. package/dist/services/sentry.d.ts +2 -5
  38. package/dist/types.d.ts +5 -13
  39. package/env +0 -0
  40. package/package.json +12 -12
  41. package/scripts/build_dev.sh +3 -0
  42. package/scripts/build_prod.sh +3 -0
  43. package/scripts/postpublish.ts +10 -0
  44. package/scripts/start.sh +3 -0
  45. package/dist/index.js.LICENSE.txt +0 -114
@@ -0,0 +1,197 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for src/components/context/ChannelsContext.tsx</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="../../../prettify.css" />
9
+ <link rel="stylesheet" href="../../../base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="../../../favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(../../../sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="../../../index.html">All files</a> / <a href="index.html">src/components/context</a> ChannelsContext.tsx</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">69.23% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>9/13</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">100% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>0/0</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">33.33% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>1/3</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">69.23% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>9/13</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
55
+ Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
+ </p>
57
+ </div>
58
+ <div class='status-line medium'></div>
59
+ <pre><table class="coverage">
60
+ <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
61
+ <a name='L2'></a><a href='#L2'>2</a>
62
+ <a name='L3'></a><a href='#L3'>3</a>
63
+ <a name='L4'></a><a href='#L4'>4</a>
64
+ <a name='L5'></a><a href='#L5'>5</a>
65
+ <a name='L6'></a><a href='#L6'>6</a>
66
+ <a name='L7'></a><a href='#L7'>7</a>
67
+ <a name='L8'></a><a href='#L8'>8</a>
68
+ <a name='L9'></a><a href='#L9'>9</a>
69
+ <a name='L10'></a><a href='#L10'>10</a>
70
+ <a name='L11'></a><a href='#L11'>11</a>
71
+ <a name='L12'></a><a href='#L12'>12</a>
72
+ <a name='L13'></a><a href='#L13'>13</a>
73
+ <a name='L14'></a><a href='#L14'>14</a>
74
+ <a name='L15'></a><a href='#L15'>15</a>
75
+ <a name='L16'></a><a href='#L16'>16</a>
76
+ <a name='L17'></a><a href='#L17'>17</a>
77
+ <a name='L18'></a><a href='#L18'>18</a>
78
+ <a name='L19'></a><a href='#L19'>19</a>
79
+ <a name='L20'></a><a href='#L20'>20</a>
80
+ <a name='L21'></a><a href='#L21'>21</a>
81
+ <a name='L22'></a><a href='#L22'>22</a>
82
+ <a name='L23'></a><a href='#L23'>23</a>
83
+ <a name='L24'></a><a href='#L24'>24</a>
84
+ <a name='L25'></a><a href='#L25'>25</a>
85
+ <a name='L26'></a><a href='#L26'>26</a>
86
+ <a name='L27'></a><a href='#L27'>27</a>
87
+ <a name='L28'></a><a href='#L28'>28</a>
88
+ <a name='L29'></a><a href='#L29'>29</a>
89
+ <a name='L30'></a><a href='#L30'>30</a>
90
+ <a name='L31'></a><a href='#L31'>31</a>
91
+ <a name='L32'></a><a href='#L32'>32</a>
92
+ <a name='L33'></a><a href='#L33'>33</a>
93
+ <a name='L34'></a><a href='#L34'>34</a>
94
+ <a name='L35'></a><a href='#L35'>35</a>
95
+ <a name='L36'></a><a href='#L36'>36</a>
96
+ <a name='L37'></a><a href='#L37'>37</a>
97
+ <a name='L38'></a><a href='#L38'>38</a>
98
+ <a name='L39'></a><a href='#L39'>39</a>
99
+ <a name='L40'></a><a href='#L40'>40</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">3x</span>
100
+ <span class="cline-any cline-neutral">&nbsp;</span>
101
+ <span class="cline-any cline-neutral">&nbsp;</span>
102
+ <span class="cline-any cline-neutral">&nbsp;</span>
103
+ <span class="cline-any cline-yes">3x</span>
104
+ <span class="cline-any cline-neutral">&nbsp;</span>
105
+ <span class="cline-any cline-no">&nbsp;</span>
106
+ <span class="cline-any cline-neutral">&nbsp;</span>
107
+ <span class="cline-any cline-neutral">&nbsp;</span>
108
+ <span class="cline-any cline-yes">3x</span>
109
+ <span class="cline-any cline-yes">2x</span>
110
+ <span class="cline-any cline-yes">2x</span>
111
+ <span class="cline-any cline-neutral">&nbsp;</span>
112
+ <span class="cline-any cline-yes">2x</span>
113
+ <span class="cline-any cline-no">&nbsp;</span>
114
+ <span class="cline-any cline-neutral">&nbsp;</span>
115
+ <span class="cline-any cline-neutral">&nbsp;</span>
116
+ <span class="cline-any cline-neutral">&nbsp;</span>
117
+ <span class="cline-any cline-neutral">&nbsp;</span>
118
+ <span class="cline-any cline-no">&nbsp;</span>
119
+ <span class="cline-any cline-no">&nbsp;</span>
120
+ <span class="cline-any cline-neutral">&nbsp;</span>
121
+ <span class="cline-any cline-neutral">&nbsp;</span>
122
+ <span class="cline-any cline-yes">2x</span>
123
+ <span class="cline-any cline-neutral">&nbsp;</span>
124
+ <span class="cline-any cline-neutral">&nbsp;</span>
125
+ <span class="cline-any cline-neutral">&nbsp;</span>
126
+ <span class="cline-any cline-neutral">&nbsp;</span>
127
+ <span class="cline-any cline-neutral">&nbsp;</span>
128
+ <span class="cline-any cline-neutral">&nbsp;</span>
129
+ <span class="cline-any cline-neutral">&nbsp;</span>
130
+ <span class="cline-any cline-neutral">&nbsp;</span>
131
+ <span class="cline-any cline-neutral">&nbsp;</span>
132
+ <span class="cline-any cline-neutral">&nbsp;</span>
133
+ <span class="cline-any cline-neutral">&nbsp;</span>
134
+ <span class="cline-any cline-neutral">&nbsp;</span>
135
+ <span class="cline-any cline-yes">3x</span>
136
+ <span class="cline-any cline-yes">3x</span>
137
+ <span class="cline-any cline-neutral">&nbsp;</span>
138
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import React, { createContext, useRef, useState } from 'react'
139
+ import { Channel } from '../../types'
140
+ import type { DataState, HookData } from './types'
141
+ &nbsp;
142
+ const ChannelsContext = createContext&lt;DataState&lt;Channel&gt;&gt;({
143
+ data: {},
144
+ setData: <span class="fstat-no" title="function not covered" >() =</span>&gt; <span class="cstat-no" title="statement not covered" >null,</span>
145
+ })
146
+ &nbsp;
147
+ const ChannelsContextProvider: React.FC = (props) =&gt; {
148
+ const [ widgetState, setWidgetState ] = useState({})
149
+ const widgetStateRef = useRef(widgetState)
150
+ &nbsp;
151
+ const handleSetWidgetState = <span class="fstat-no" title="function not covered" >(w</span>idgetId: string, channels: HookData&lt;Channel&gt;) =&gt; {
152
+ const newChannels = <span class="cstat-no" title="statement not covered" >{</span>
153
+ ...widgetStateRef.current,
154
+ [widgetId]: channels,
155
+ }
156
+ &nbsp;
157
+ <span class="cstat-no" title="statement not covered" > widgetStateRef.current = newChannels</span>
158
+ <span class="cstat-no" title="statement not covered" > setWidgetState(newChannels)</span>
159
+ }
160
+ &nbsp;
161
+ return (
162
+ &lt;ChannelsContext.Provider
163
+ value={{
164
+ data: widgetState,
165
+ setData: handleSetWidgetState,
166
+ }}
167
+ &gt;
168
+ {props.children}
169
+ &lt;/ChannelsContext.Provider&gt;
170
+ )
171
+ }
172
+ &nbsp;
173
+ export {
174
+ ChannelsContext,
175
+ ChannelsContextProvider,
176
+ }
177
+ &nbsp;</pre></td></tr></table></pre>
178
+
179
+ <div class='push'></div><!-- for sticky footer -->
180
+ </div><!-- /wrapper -->
181
+ <div class='footer quiet pad2 space-top1 center small'>
182
+ Code coverage generated by
183
+ <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
184
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
185
+ </div>
186
+ </div>
187
+ <script src="../../../prettify.js"></script>
188
+ <script>
189
+ window.onload = function () {
190
+ prettyPrint();
191
+ };
192
+ </script>
193
+ <script src="../../../sorter.js"></script>
194
+ <script src="../../../block-navigation.js"></script>
195
+ </body>
196
+ </html>
197
+
@@ -0,0 +1,179 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for src/components/context/OrganizationSubscriptionsContext.tsx</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="../../../prettify.css" />
9
+ <link rel="stylesheet" href="../../../base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="../../../favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(../../../sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="../../../index.html">All files</a> / <a href="index.html">src/components/context</a> OrganizationSubscriptionsContext.tsx</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">87.5% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>7/8</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">100% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>0/0</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">50% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>1/2</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">87.5% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>7/8</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
55
+ Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
+ </p>
57
+ </div>
58
+ <div class='status-line high'></div>
59
+ <pre><table class="coverage">
60
+ <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
61
+ <a name='L2'></a><a href='#L2'>2</a>
62
+ <a name='L3'></a><a href='#L3'>3</a>
63
+ <a name='L4'></a><a href='#L4'>4</a>
64
+ <a name='L5'></a><a href='#L5'>5</a>
65
+ <a name='L6'></a><a href='#L6'>6</a>
66
+ <a name='L7'></a><a href='#L7'>7</a>
67
+ <a name='L8'></a><a href='#L8'>8</a>
68
+ <a name='L9'></a><a href='#L9'>9</a>
69
+ <a name='L10'></a><a href='#L10'>10</a>
70
+ <a name='L11'></a><a href='#L11'>11</a>
71
+ <a name='L12'></a><a href='#L12'>12</a>
72
+ <a name='L13'></a><a href='#L13'>13</a>
73
+ <a name='L14'></a><a href='#L14'>14</a>
74
+ <a name='L15'></a><a href='#L15'>15</a>
75
+ <a name='L16'></a><a href='#L16'>16</a>
76
+ <a name='L17'></a><a href='#L17'>17</a>
77
+ <a name='L18'></a><a href='#L18'>18</a>
78
+ <a name='L19'></a><a href='#L19'>19</a>
79
+ <a name='L20'></a><a href='#L20'>20</a>
80
+ <a name='L21'></a><a href='#L21'>21</a>
81
+ <a name='L22'></a><a href='#L22'>22</a>
82
+ <a name='L23'></a><a href='#L23'>23</a>
83
+ <a name='L24'></a><a href='#L24'>24</a>
84
+ <a name='L25'></a><a href='#L25'>25</a>
85
+ <a name='L26'></a><a href='#L26'>26</a>
86
+ <a name='L27'></a><a href='#L27'>27</a>
87
+ <a name='L28'></a><a href='#L28'>28</a>
88
+ <a name='L29'></a><a href='#L29'>29</a>
89
+ <a name='L30'></a><a href='#L30'>30</a>
90
+ <a name='L31'></a><a href='#L31'>31</a>
91
+ <a name='L32'></a><a href='#L32'>32</a>
92
+ <a name='L33'></a><a href='#L33'>33</a>
93
+ <a name='L34'></a><a href='#L34'>34</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">3x</span>
94
+ <span class="cline-any cline-neutral">&nbsp;</span>
95
+ <span class="cline-any cline-neutral">&nbsp;</span>
96
+ <span class="cline-any cline-neutral">&nbsp;</span>
97
+ <span class="cline-any cline-neutral">&nbsp;</span>
98
+ <span class="cline-any cline-neutral">&nbsp;</span>
99
+ <span class="cline-any cline-neutral">&nbsp;</span>
100
+ <span class="cline-any cline-neutral">&nbsp;</span>
101
+ <span class="cline-any cline-neutral">&nbsp;</span>
102
+ <span class="cline-any cline-yes">3x</span>
103
+ <span class="cline-any cline-neutral">&nbsp;</span>
104
+ <span class="cline-any cline-no">&nbsp;</span>
105
+ <span class="cline-any cline-neutral">&nbsp;</span>
106
+ <span class="cline-any cline-neutral">&nbsp;</span>
107
+ <span class="cline-any cline-yes">3x</span>
108
+ <span class="cline-any cline-yes">2x</span>
109
+ <span class="cline-any cline-neutral">&nbsp;</span>
110
+ <span class="cline-any cline-yes">2x</span>
111
+ <span class="cline-any cline-neutral">&nbsp;</span>
112
+ <span class="cline-any cline-neutral">&nbsp;</span>
113
+ <span class="cline-any cline-neutral">&nbsp;</span>
114
+ <span class="cline-any cline-neutral">&nbsp;</span>
115
+ <span class="cline-any cline-neutral">&nbsp;</span>
116
+ <span class="cline-any cline-neutral">&nbsp;</span>
117
+ <span class="cline-any cline-neutral">&nbsp;</span>
118
+ <span class="cline-any cline-neutral">&nbsp;</span>
119
+ <span class="cline-any cline-neutral">&nbsp;</span>
120
+ <span class="cline-any cline-neutral">&nbsp;</span>
121
+ <span class="cline-any cline-neutral">&nbsp;</span>
122
+ <span class="cline-any cline-neutral">&nbsp;</span>
123
+ <span class="cline-any cline-yes">3x</span>
124
+ <span class="cline-any cline-yes">3x</span>
125
+ <span class="cline-any cline-neutral">&nbsp;</span>
126
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import React, { createContext, useState } from 'react'
127
+ import { Monetization } from '../../types'
128
+ &nbsp;
129
+ &nbsp;
130
+ interface OrganizationSubscriptionsContextState {
131
+ subscriptions: Monetization[],
132
+ setSubscriptions: (subscriptions: Monetization[]) =&gt; void,
133
+ }
134
+ &nbsp;
135
+ const OrganizationSubscriptionsContext = createContext&lt;OrganizationSubscriptionsContextState&gt;({
136
+ subscriptions: [],
137
+ setSubscriptions: <span class="fstat-no" title="function not covered" >() =</span>&gt; <span class="cstat-no" title="statement not covered" >null,</span>
138
+ })
139
+ &nbsp;
140
+ const OrganizationSubscriptionsContextProvider: React.FC = (props) =&gt; {
141
+ const [ organizationSubscriptions, setOrganizationSubscriptions ] = useState&lt;Monetization[]&gt;([])
142
+ &nbsp;
143
+ return (
144
+ &lt;OrganizationSubscriptionsContext.Provider
145
+ value={{
146
+ subscriptions: organizationSubscriptions,
147
+ setSubscriptions: setOrganizationSubscriptions,
148
+ }}
149
+ &gt;
150
+ {props.children}
151
+ &lt;/OrganizationSubscriptionsContext.Provider&gt;
152
+ )
153
+ }
154
+ &nbsp;
155
+ export {
156
+ OrganizationSubscriptionsContextProvider,
157
+ OrganizationSubscriptionsContext,
158
+ }
159
+ &nbsp;</pre></td></tr></table></pre>
160
+
161
+ <div class='push'></div><!-- for sticky footer -->
162
+ </div><!-- /wrapper -->
163
+ <div class='footer quiet pad2 space-top1 center small'>
164
+ Code coverage generated by
165
+ <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
166
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
167
+ </div>
168
+ </div>
169
+ <script src="../../../prettify.js"></script>
170
+ <script>
171
+ window.onload = function () {
172
+ prettyPrint();
173
+ };
174
+ </script>
175
+ <script src="../../../sorter.js"></script>
176
+ <script src="../../../block-navigation.js"></script>
177
+ </body>
178
+ </html>
179
+
@@ -0,0 +1,179 @@
1
+
2
+ <!doctype html>
3
+ <html lang="en">
4
+
5
+ <head>
6
+ <title>Code coverage report for src/components/context/PurchasesWithVideosContext.tsx</title>
7
+ <meta charset="utf-8" />
8
+ <link rel="stylesheet" href="../../../prettify.css" />
9
+ <link rel="stylesheet" href="../../../base.css" />
10
+ <link rel="shortcut icon" type="image/x-icon" href="../../../favicon.png" />
11
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
12
+ <style type='text/css'>
13
+ .coverage-summary .sorter {
14
+ background-image: url(../../../sort-arrow-sprite.png);
15
+ }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <div class='wrapper'>
21
+ <div class='pad1'>
22
+ <h1><a href="../../../index.html">All files</a> / <a href="index.html">src/components/context</a> PurchasesWithVideosContext.tsx</h1>
23
+ <div class='clearfix'>
24
+
25
+ <div class='fl pad1y space-right2'>
26
+ <span class="strong">87.5% </span>
27
+ <span class="quiet">Statements</span>
28
+ <span class='fraction'>7/8</span>
29
+ </div>
30
+
31
+
32
+ <div class='fl pad1y space-right2'>
33
+ <span class="strong">100% </span>
34
+ <span class="quiet">Branches</span>
35
+ <span class='fraction'>0/0</span>
36
+ </div>
37
+
38
+
39
+ <div class='fl pad1y space-right2'>
40
+ <span class="strong">50% </span>
41
+ <span class="quiet">Functions</span>
42
+ <span class='fraction'>1/2</span>
43
+ </div>
44
+
45
+
46
+ <div class='fl pad1y space-right2'>
47
+ <span class="strong">87.5% </span>
48
+ <span class="quiet">Lines</span>
49
+ <span class='fraction'>7/8</span>
50
+ </div>
51
+
52
+
53
+ </div>
54
+ <p class="quiet">
55
+ Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
+ </p>
57
+ </div>
58
+ <div class='status-line high'></div>
59
+ <pre><table class="coverage">
60
+ <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
61
+ <a name='L2'></a><a href='#L2'>2</a>
62
+ <a name='L3'></a><a href='#L3'>3</a>
63
+ <a name='L4'></a><a href='#L4'>4</a>
64
+ <a name='L5'></a><a href='#L5'>5</a>
65
+ <a name='L6'></a><a href='#L6'>6</a>
66
+ <a name='L7'></a><a href='#L7'>7</a>
67
+ <a name='L8'></a><a href='#L8'>8</a>
68
+ <a name='L9'></a><a href='#L9'>9</a>
69
+ <a name='L10'></a><a href='#L10'>10</a>
70
+ <a name='L11'></a><a href='#L11'>11</a>
71
+ <a name='L12'></a><a href='#L12'>12</a>
72
+ <a name='L13'></a><a href='#L13'>13</a>
73
+ <a name='L14'></a><a href='#L14'>14</a>
74
+ <a name='L15'></a><a href='#L15'>15</a>
75
+ <a name='L16'></a><a href='#L16'>16</a>
76
+ <a name='L17'></a><a href='#L17'>17</a>
77
+ <a name='L18'></a><a href='#L18'>18</a>
78
+ <a name='L19'></a><a href='#L19'>19</a>
79
+ <a name='L20'></a><a href='#L20'>20</a>
80
+ <a name='L21'></a><a href='#L21'>21</a>
81
+ <a name='L22'></a><a href='#L22'>22</a>
82
+ <a name='L23'></a><a href='#L23'>23</a>
83
+ <a name='L24'></a><a href='#L24'>24</a>
84
+ <a name='L25'></a><a href='#L25'>25</a>
85
+ <a name='L26'></a><a href='#L26'>26</a>
86
+ <a name='L27'></a><a href='#L27'>27</a>
87
+ <a name='L28'></a><a href='#L28'>28</a>
88
+ <a name='L29'></a><a href='#L29'>29</a>
89
+ <a name='L30'></a><a href='#L30'>30</a>
90
+ <a name='L31'></a><a href='#L31'>31</a>
91
+ <a name='L32'></a><a href='#L32'>32</a>
92
+ <a name='L33'></a><a href='#L33'>33</a>
93
+ <a name='L34'></a><a href='#L34'>34</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">3x</span>
94
+ <span class="cline-any cline-neutral">&nbsp;</span>
95
+ <span class="cline-any cline-neutral">&nbsp;</span>
96
+ <span class="cline-any cline-neutral">&nbsp;</span>
97
+ <span class="cline-any cline-neutral">&nbsp;</span>
98
+ <span class="cline-any cline-neutral">&nbsp;</span>
99
+ <span class="cline-any cline-neutral">&nbsp;</span>
100
+ <span class="cline-any cline-neutral">&nbsp;</span>
101
+ <span class="cline-any cline-neutral">&nbsp;</span>
102
+ <span class="cline-any cline-yes">3x</span>
103
+ <span class="cline-any cline-neutral">&nbsp;</span>
104
+ <span class="cline-any cline-no">&nbsp;</span>
105
+ <span class="cline-any cline-neutral">&nbsp;</span>
106
+ <span class="cline-any cline-neutral">&nbsp;</span>
107
+ <span class="cline-any cline-yes">3x</span>
108
+ <span class="cline-any cline-yes">2x</span>
109
+ <span class="cline-any cline-neutral">&nbsp;</span>
110
+ <span class="cline-any cline-yes">2x</span>
111
+ <span class="cline-any cline-neutral">&nbsp;</span>
112
+ <span class="cline-any cline-neutral">&nbsp;</span>
113
+ <span class="cline-any cline-neutral">&nbsp;</span>
114
+ <span class="cline-any cline-neutral">&nbsp;</span>
115
+ <span class="cline-any cline-neutral">&nbsp;</span>
116
+ <span class="cline-any cline-neutral">&nbsp;</span>
117
+ <span class="cline-any cline-neutral">&nbsp;</span>
118
+ <span class="cline-any cline-neutral">&nbsp;</span>
119
+ <span class="cline-any cline-neutral">&nbsp;</span>
120
+ <span class="cline-any cline-neutral">&nbsp;</span>
121
+ <span class="cline-any cline-neutral">&nbsp;</span>
122
+ <span class="cline-any cline-neutral">&nbsp;</span>
123
+ <span class="cline-any cline-yes">3x</span>
124
+ <span class="cline-any cline-yes">3x</span>
125
+ <span class="cline-any cline-neutral">&nbsp;</span>
126
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import React, { createContext, useState } from 'react'
127
+ import { Purchase } from '../../types'
128
+ &nbsp;
129
+ &nbsp;
130
+ interface PurchasesWithVideosContextState {
131
+ purchases: Purchase[],
132
+ setPurchases: (purchases: Purchase[]) =&gt; void
133
+ }
134
+ &nbsp;
135
+ const PurchasesWithVideosContext = createContext&lt;PurchasesWithVideosContextState&gt;({
136
+ purchases: [],
137
+ setPurchases: <span class="fstat-no" title="function not covered" >() =</span>&gt; <span class="cstat-no" title="statement not covered" >null,</span>
138
+ })
139
+ &nbsp;
140
+ const PurchasesWithVideosContextProvider: React.FC = (props) =&gt; {
141
+ const [ purchases, setPurchases ] = useState&lt;Purchase[]&gt;([])
142
+ &nbsp;
143
+ return (
144
+ &lt;PurchasesWithVideosContext.Provider
145
+ value={{
146
+ purchases,
147
+ setPurchases,
148
+ }}
149
+ &gt;
150
+ {props.children}
151
+ &lt;/PurchasesWithVideosContext.Provider&gt;
152
+ )
153
+ }
154
+ &nbsp;
155
+ export {
156
+ PurchasesWithVideosContext,
157
+ PurchasesWithVideosContextProvider,
158
+ }
159
+ &nbsp;</pre></td></tr></table></pre>
160
+
161
+ <div class='push'></div><!-- for sticky footer -->
162
+ </div><!-- /wrapper -->
163
+ <div class='footer quiet pad2 space-top1 center small'>
164
+ Code coverage generated by
165
+ <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
166
+ at Sat Oct 23 2021 10:01:51 GMT+0200 (Central European Summer Time)
167
+ </div>
168
+ </div>
169
+ <script src="../../../prettify.js"></script>
170
+ <script>
171
+ window.onload = function () {
172
+ prettyPrint();
173
+ };
174
+ </script>
175
+ <script src="../../../sorter.js"></script>
176
+ <script src="../../../block-navigation.js"></script>
177
+ </body>
178
+ </html>
179
+