GithubHelp home page GithubHelp logo

Fusion.Unpack about fusion HOT 6 CLOSED

elttob avatar elttob commented on May 7, 2024 1
Fusion.Unpack

from fusion.

Comments (6)

Gargafield avatar Gargafield commented on May 7, 2024

I just realized that this is already possible somewhat using unpack.

local New, Children, OnEvent, OnChange, State, Computed = unpack(Fusion, 1, 6)

from fusion.

dphfox avatar dphfox commented on May 7, 2024

This is something I experimented with in prototypes before, and I do think it's good for conciseness!

The problem is, what is important enough to be returned by this function? Include too much, and it gets unreasonably long and pollutes the script namespace. Include too little, and it has limited utility. I'm not sure where the line would be drawn.

from fusion.

Gargafield avatar Gargafield commented on May 7, 2024

This is something I experimented with in prototypes before, and I do think it's good for conciseness!

The problem is, what is important enough to be returned by this function? Include too much, and it gets unreasonably long and pollutes the script namespace. Include too little, and it has limited utility. I'm not sure where the line would be drawn.

I mostly use the first 6 indexes See here. The rest is only used in "special cases".

from fusion.

catgirlinspace avatar catgirlinspace commented on May 7, 2024

Maybe split them into 3 different functions for instances, state management, and animations just like the API reference page.

from fusion.

dphfox avatar dphfox commented on May 7, 2024

I've made a related feature request for Luau that might help with this: https://devforum.roblox.com/t/luau-table-destructuring-for-variables-and-type-definitions/1484752

from fusion.

dphfox avatar dphfox commented on May 7, 2024

After a lot of thought about this, I think the problem with this feature request is that there's no good way to determine what should be returned here. In the interest of simplicity and explicitness I think perhaps it's better to stick to just importing stuff manually - this could always be easily implemented in user space if it's desired.

from fusion.

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.