Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 15cb762a
authored
May 04, 2011
by
Sascha Depold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deleted old example
1 parent
9b7282d3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
48 deletions
examples/ChainQueries/app.js
examples/ChainQueries/app.js
deleted
100644 → 0
View file @
9b7282d
/*
Title: Using the chainQueries function
This example demonstrates the use of chainQueries.
*/
var
Sequelize
=
require
(
__dirname
+
"/../../lib/sequelize/Sequelize"
).
Sequelize
var
sys
=
require
(
"sys"
)
var
Class
=
function
(){
sys
.
log
(
"You've just created a new instance!"
)
}
Class
.
prototype
.
add
=
function
(
a
,
b
,
callback
){
this
.
result
=
a
+
b
sys
.
log
(
"The result: "
+
this
.
result
)
callback
(
this
.
result
)
}
sys
.
log
(
"First of all the old and obsolete way:"
)
Sequelize
.
chainQueries
([
{
add
:
(
new
Class
()),
params
:
[
1
,
2
]},
{
add
:
(
new
Class
()),
params
:
[
2
,
3
]}
],
function
()
{
sys
.
log
(
"And we did it!"
)
})
sys
.
puts
(
""
)
sys
.
log
(
"The new fashioned way is about removing the array and pass an arbitrary amount of parameters!"
)
sys
.
log
(
"Just pass as many hashes as you want, but at the end a function as callback!"
)
Sequelize
.
chainQueries
(
{
add
:
new
Class
(),
params
:
[
1
,
2
]},
{
add
:
new
Class
(),
params
:
[
2
,
3
]},
function
()
{
sys
.
log
(
"And we did it! Great!"
)
}
)
sys
.
puts
(
""
)
sys
.
log
(
"As you see we add some values two times."
)
sys
.
log
(
"Let's say you want to call a method on multiple objects with the same or no parameters!"
)
Sequelize
.
chainQueries
(
{
add
:
[
new
Class
(),
new
Class
()],
params
:
[
1
,
2
]},
function
()
{
sys
.
log
(
"And we did it! Great!"
)
}
)
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment