Git Product home page Git Product logo

Comments (6)

russplaysguitar avatar russplaysguitar commented on August 19, 2024

_.extend() simply loops over the publicly accessible members of an object/struct and copies them to the new object/struct.

Coldfusion's component extends="..." syntax allows you to define actual inheritance, which is what it sounds like you're looking for?

from underscorecf.

russplaysguitar avatar russplaysguitar commented on August 19, 2024

bump

from underscorecf.

jfrux avatar jfrux commented on August 19, 2024

not necessarily looking for extends, looking to take the function definitions of one cfc and use them as mixin functions on another cfc.

extends only allows one cfc, but if we want to make two diff cfc's mixin to the existing cfc.

from underscorecf.

jfrux avatar jfrux commented on August 19, 2024

similar to how you can include("mixin_functions.cfm") within a component and pull in a cfm of functions but without the need for the cfm file :)

maybe a new module for handling mixins...? :D

component name="core" {
        ...
        public any function includes(mixins...) {
               for (mixin in mixins) {
                     var mixinFuncs = getComponentMetaData(mixin);
                     for (func in mixinFuncs) {
                           this[func.name] = func;
                     }
               }
        }
        ...
}
component name="someBasicClass" extends="foundry.core"  {
      includes("./someMixinFuncs");
}

from underscorecf.

russplaysguitar avatar russplaysguitar commented on August 19, 2024

Hmm, can you provide an example of how you're trying to use _.extend() ?

from underscorecf.

russplaysguitar avatar russplaysguitar commented on August 19, 2024

i just reviewed this again, and i'm not sure that this sort of functionality makes sense for this project, given that it is intended to be a port of Underscore.js and there isn't anything in Underscore.js that does mixins for classes (yet)

from underscorecf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.