Coder Social home page Coder Social logo

TNG name about tng-hooks HOT 3 CLOSED

getify avatar getify commented on May 31, 2024
TNG name

from tng-hooks.

Comments (3)

damassi avatar damassi commented on May 31, 2024 2

Ok this makes sense! thank you for explaining 👍

from tng-hooks.

getify avatar getify commented on May 31, 2024

The TNG (pronounced "ting") name has a few meanings/reasons:

  • It started as "totally not globals" -- a nod to the idea that it's like having global storage but not-global because it's in closures

  • I planned a talk to introduce TNG, called "State Track: The Next Generation" (a nod to star trek TNG, etc)

  • It's hard to get unique names on npm these days, especially in the realm of react/hooks/etc. TNG is a nice unique moniker.


My thought was, if people didn't like using the name TNG, they can always call it some other name. In node: var { TNG: coolHooks, .. } = require("tng-hooks");. In the browser, window.coolHooks = window.TNG;.

from tng-hooks.

getify avatar getify commented on May 31, 2024

Why not "makeHooks" or import { useState } from 'fn-hooks'? etc. To invoke everything with "TNG" doesn't seem meaningful language-wise.

I don't have TNG exporting itself as an ES6 module yet, but the various hooks, like useState(..), etc, are in fact individual "exports" on the API of this lib. You don't say TNG.useState(..), you just say useState(..) (just like in React).

That's why in node you do var {TNG,useState,useEffect} = require("tng-hooks");, because you're individually "importing" each of those "exported" identifiers as you see fit.

The only time you use the TNG name itself is for the function that creates the wrapped/hooked functions (aka "Articulated Functions"). And as I said above, if you don't like saying myFunc = TNG(myFunc);, you can rename TNG to whatever you prefer, like makeHooks(..) or whatever, and then say myFunc = makeHooks(myFunc);.

from tng-hooks.

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.