Skip to content

Put config as argument to modifiers #9

Description

@likerRr

config shouldn't be modified on the fly.

Add method like provideConfig(modifierType, modifierFn, config) to apply new config. It needs in order to prevent partial config change during modifier runtime and also to prevent unexpected situations with changing config object by reference.

Modifier must be a function which accepts config parameter and should return a function which accepts level and parts

const config = Object.assign({}, modifierFn.defaults, modifierConfig);
modifiers.set(modifierFn, modifierFn(config, debug));

debug - true/false if debug is enabled

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions