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
dd5e2adc
Commit
dd5e2adc
authored
9 years ago
by
Kevin Jahns
Browse files
Options
Downloads
Patches
Plain Diff
update
parent
ee983cef
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Struct.js
+1
-1
1 addition, 1 deletion
src/Struct.js
src/y.js
+28
-28
28 additions, 28 deletions
src/y.js
with
29 additions
and
29 deletions
src/Struct.js
+
1
−
1
View file @
dd5e2adc
...
...
@@ -172,7 +172,7 @@ var Struct = {
left
.
right
=
op
.
id
yield
*
this
.
setOperation
(
left
)
}
else
{
op
.
right
=
op
.
parentSub
?
(
parent
.
map
[
op
.
parentSub
]
||
null
)
:
parent
.
start
op
.
right
=
op
.
parentSub
?
parent
.
map
[
op
.
parentSub
]
||
null
:
parent
.
start
}
// reconnect right
if
(
op
.
right
!=
null
)
{
...
...
This diff is collapsed.
Click to expand it.
src/y.js
+
28
−
28
View file @
dd5e2adc
/* @flow */
function
Y
(
opts
)
{
var
def
=
Promise
.
defer
()
;
new
YConfig
(
opts
,
function
(
yconfig
){
//eslint-disable-line
yconfig
.
db
.
whenUserIdSet
(
function
(){
def
.
resolve
(
yconfig
)
;
})
;
})
;
return
def
.
promise
;
var
def
=
Promise
.
defer
()
new
YConfig
(
opts
,
function
(
yconfig
)
{
//
eslint-disable-line
yconfig
.
db
.
whenUserIdSet
(
function
()
{
def
.
resolve
(
yconfig
)
})
})
return
def
.
promise
}
class
YConfig
{
//eslint-disable-line no-unused-vars
class
YConfig
{
//
eslint-disable-line no-unused-vars
constructor
(
opts
,
callback
)
{
this
.
db
=
new
Y
[
opts
.
db
.
name
](
this
,
opts
.
db
)
;
this
.
connector
=
new
Y
[
opts
.
connector
.
name
](
this
,
opts
.
connector
)
;
var
yconfig
=
this
;
this
.
db
.
requestTransaction
(
function
*
(){
this
.
db
=
new
Y
[
opts
.
db
.
name
](
this
,
opts
.
db
)
this
.
connector
=
new
Y
[
opts
.
connector
.
name
](
this
,
opts
.
connector
)
var
yconfig
=
this
this
.
db
.
requestTransaction
(
function
*
()
{
// create initial Map type
var
model
=
{
id
:
[
"
_
"
,
0
],
struct
:
"
Map
"
,
type
:
"
Map
"
,
id
:
[
'
_
'
,
0
],
struct
:
'
Map
'
,
type
:
'
Map
'
,
map
:
{}
}
;
yield
*
this
.
addOperation
(
model
)
;
var
root
=
yield
*
this
.
createType
(
model
)
;
this
.
store
.
y
.
root
=
root
;
callback
(
yconfig
)
;
})
;
}
yield
*
this
.
addOperation
(
model
)
var
root
=
yield
*
this
.
createType
(
model
)
this
.
store
.
y
.
root
=
root
callback
(
yconfig
)
})
}
destroy
()
{
this
.
connector
.
disconnect
()
;
this
.
db
.
removeDatabase
()
;
this
.
connector
=
null
;
this
.
db
=
null
;
this
.
transact
=
function
(){
throw
new
Error
(
"
Remember?, you destroyed this type ;)
"
);
}
;
this
.
connector
.
disconnect
()
this
.
db
.
removeDatabase
()
this
.
connector
=
null
this
.
db
=
null
this
.
transact
=
function
()
{
throw
new
Error
(
'
Remember?, you destroyed this type ;)
'
)
}
}
}
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