Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Y
yjs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sweng-group-15
yjs
Commits
059f72ff
Commit
059f72ff
authored
8 years ago
by
Kevin Jahns
Browse files
Options
Downloads
Patches
Plain Diff
fix init problems with v12, update examples to be synchronous
parent
d2d74a64
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dist
+1
-1
1 addition, 1 deletion
dist
src/y.js
+9
-4
9 additions, 4 deletions
src/y.js
with
10 additions
and
5 deletions
dist
@
15615024
Compare
4726c71d
...
15615024
Subproject commit
4726c71dd0e95db9200b92c4434729954539edd9
Subproject commit
15615024f38b93198775bd71f26c5096ffc95a0a
This diff is collapsed.
Click to expand it.
src/y.js
+
9
−
4
View file @
059f72ff
...
...
@@ -140,6 +140,9 @@ class YConfig {
for
(
var
propertyname
in
opts
.
share
)
{
var
typeConstructor
=
opts
.
share
[
propertyname
].
split
(
'
(
'
)
var
typeName
=
typeConstructor
.
splice
(
0
,
1
)
var
type
=
Y
[
typeName
]
var
typedef
=
type
.
typeDefinition
var
id
=
[
'
_
'
,
typedef
.
struct
+
'
_
'
+
typeName
+
'
_
'
+
propertyname
+
'
_
'
+
typeConstructor
]
var
args
=
[]
if
(
typeConstructor
.
length
===
1
)
{
try
{
...
...
@@ -147,11 +150,13 @@ class YConfig {
}
catch
(
e
)
{
throw
new
Error
(
'
Was not able to parse type definition! (share.
'
+
propertyname
+
'
)
'
)
}
if
(
type
.
typeDefinition
.
parseArguments
==
null
)
{
throw
new
Error
(
typeName
+
'
does not expect arguments!
'
)
}
else
{
args
=
typedef
.
parseArguments
(
args
[
0
])[
1
]
}
}
var
type
=
Y
[
typeName
]
var
typedef
=
type
.
typeDefinition
var
id
=
[
'
_
'
,
typedef
.
struct
+
'
_
'
+
typeName
+
'
_
'
+
propertyname
+
'
_
'
+
typeConstructor
]
share
[
propertyname
]
=
this
.
store
.
createType
(
type
.
apply
(
typedef
,
args
),
id
)
share
[
propertyname
]
=
yield
*
this
.
store
.
initType
.
call
(
this
,
id
,
args
)
}
this
.
store
.
whenTransactionsFinished
()
.
then
(
callback
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment