Thank you for considering contributing to Embla Carousel, contributions are welcome!
All code contributions should follow the current code style
. Embla Carousel is written with function factories
that expose an object containing a set of public methods. Note that the public method object should be flat and frozen. Below is an example:
// Declare parameter types
type Params = {
parameter: number
}
// Declare public method types
export type FunctionFactory = {
publicMethod: () => number
}
// Declare a function factory
export function FunctionFactory(params: Params): FunctionFactory {
const { parameter } = params
const privateVariable = 10
function publicMethod() {
return parameter + privateVariable;
}
const self: FunctionFactory = {
publicMethod
}
return Object.freeze(self)
}
For any new features it's important to follow this checklist:
Discuss:
Open an issue before starting any significant work. Let's discuss to see how the proposed feature fits within Embla Carousels's vision.Prettier:
Make sure your editor adheres to prettier configuration files.Code style:
Follow the current code style as described here.Create a Pull Request:
Make sure your branch name follows this patternfeature/branchname-goes-here
.
Your code will be used as part of an open source product if merged. By submitting a Pull Request, you are giving your consent for your code to be integrated into Embla Carousel as part of an open source product.