Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gl-react-native-v2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ym
gl-react-native-v2
Commits
65a13004
Commit
65a13004
authored
Feb 08, 2017
by
Gaëtan Renaudeau
Committed by
GitHub
Feb 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #139 from lshir/nopromise
Remove promise-defer
parents
90095f5b
6c45e6e2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
package.json
package.json
+1
-2
src/GLCanvas.js
src/GLCanvas.js
+11
-2
No files found.
package.json
View file @
65a13004
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
"gl-react"
:
"^2.2.4"
"gl-react"
:
"^2.2.4"
},
},
"dependencies"
:
{
"dependencies"
:
{
"
invariant
"
:
"
2.2.0
"
,
"
invariant
"
:
"
2.2.0
"
"
promise-defer
"
:
"
1.0.0
"
}
}
}
}
src/GLCanvas.js
View file @
65a13004
import
invariant
from
"
invariant
"
;
import
invariant
from
"
invariant
"
;
import
React
,
{
Component
}
from
"
react
"
;
import
React
,
{
Component
}
from
"
react
"
;
import
{
requireNativeComponent
,
findNodeHandle
}
from
"
react-native
"
;
import
{
requireNativeComponent
,
findNodeHandle
}
from
"
react-native
"
;
import
defer
from
"
promise-defer
"
;
import
captureFrame
from
"
./GLCanvas.captureFrame
"
;
import
captureFrame
from
"
./GLCanvas.captureFrame
"
;
const
serializeOption
=
config
=>
const
serializeOption
=
config
=>
...
@@ -39,10 +38,20 @@ class GLCanvas extends Component {
...
@@ -39,10 +38,20 @@ class GLCanvas extends Component {
const
key
=
serializeOption
(
config
);
const
key
=
serializeOption
(
config
);
return
this
.
_pendingCaptureFrame
[
key
]
||
(
return
this
.
_pendingCaptureFrame
[
key
]
||
(
(
captureFrame
(
findNodeHandle
(
this
.
refs
.
native
),
config
),
(
captureFrame
(
findNodeHandle
(
this
.
refs
.
native
),
config
),
this
.
_pendingCaptureFrame
[
key
]
=
defer
())
this
.
_pendingCaptureFrame
[
key
]
=
this
.
_makeDeferred
())
);
);
}
}
_makeDeferred
()
{
var
defer
=
{};
var
p
=
new
Promise
(
function
(
resolve
,
reject
)
{
defer
.
resolve
=
resolve
;
defer
.
reject
;
});
defer
.
promise
=
p
;
return
defer
;
}
captureFrame
(
configArg
)
{
captureFrame
(
configArg
)
{
let
config
;
let
config
;
if
(
configArg
)
{
if
(
configArg
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment