GithubHelp home page GithubHelp logo

case about seamless-immutable HOT 9 CLOSED

mvolkmann avatar mvolkmann commented on July 20, 2024
case

from seamless-immutable.

Comments (9)

rtfeldman avatar rtfeldman commented on July 20, 2024

Which function are you referring to?

from seamless-immutable.

mvolkmann avatar mvolkmann commented on July 20, 2024

Immutable

from seamless-immutable.

mvolkmann avatar mvolkmann commented on July 20, 2024

Linters complain when you call a function that starts uppercase rather than using the "new" keyword.

var data = new Immutable(thing); // linter likes
var data = Immutable(thing); // linter complains
var data = immutable(thing); // linter likes

from seamless-immutable.

rtfeldman avatar rtfeldman commented on July 20, 2024

Ah. Fair point...I don't especially care one way or the other. Any other opinions on this? @raorao?

from seamless-immutable.

mvolkmann avatar mvolkmann commented on July 20, 2024

I know when I see an uppercase function name I immediately think it is a constructor function.

from seamless-immutable.

raorao avatar raorao commented on July 20, 2024

Personally I like the uppercase function name, since Immutable is a constructor in spirit. Perhaps there should just be a lower case version of the function in the public interface for the linted among us.

from seamless-immutable.

rtfeldman avatar rtfeldman commented on July 20, 2024

I agree about "constructor in spirit" (which was why I named it that way.)

Actually it just occurred to me that this seems easily solvable by the library end user, e.g. var immutable = require("seamless-immutable.js") - although @mvolkmann please feel free to correct me if I'm missing something. 😃

from seamless-immutable.

mvolkmann avatar mvolkmann commented on July 20, 2024

Ah, that's certainly true. But if you want to make it usable in browsers that don't support ES6 modules, I guess you'll want to expose that as a global variable.

from seamless-immutable.

rtfeldman avatar rtfeldman commented on July 20, 2024

Well, it's just as easy if you use RequireJS, Browserify, Webpack, Node, etc. - and of course if you're just attaching it to window, you can always go window.immutable = Immutable, so I think that's frictionless enough that this is worth closing.

Thanks for pointing this out!

from seamless-immutable.

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.