Skip to content

transition function implemented #2850 #2897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions modules/_transition.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
export function getTogglingfunction() {
if (arguments.length == 0) {
function inner(input) {
return !input;
}
return inner;
} else if (arguments.length != 1) {
var args = arguments;
function inner(input){
let all_arguments = Array.from(args);
all_arguments_length = all_arguments.length;
index = all_arguments.indexOf(input);
return all_arguments[(index + 1) % all_arguments_length];
}
return inner
} else if (arguments[0] instanceof Array){
args = arguments[0];
function inner(input){
let all_arguments = args;
all_arguments_length = all_arguments.length;
index = all_arguments.indexOf(input);
return all_arguments[(index + 1) % all_arguments_length];
}
return inner
} else {
obj = arguments[0];
function inner(input) {
inner_obj = obj;
return inner_obj[input];
}
return inner
}
}