lipsumar / design-system-framework

9 stars 2 forks source link

Hooks ? #24

Closed lipsumar closed 8 years ago

lipsumar commented 8 years ago

I am still not sure Handlebars should be the only template engine supported. As I'm working on a Handlebars component library with custom helpers, i need to register my helpers. As I don't want to put more code depending on Handlebars in DSF itself, I'm trying to introduce the idea of "hooks":

    "hook":{
        "init": "./dsf-hooks/init"
    },

And this in lib/dsf.js, in function init:

    if(CONFIG.hook && CONFIG.hook.init){
        require(util.path.absolute(CONFIG.hook.init))(API, callback);
    }else if(callback){
        callback();
    }
lipsumar commented 8 years ago

https://github.com/lipsumar/design-system-framework/tree/feature/plugins