GithubHelp home page GithubHelp logo

dead-claudia / mithril-helpers Goto Github PK

View Code? Open in Web Editor NEW
31.0 4.0 4.0 100 KB

A useful collection of Mithril helpers and utilities.

License: Other

JavaScript 100.00%
mithril utilities subtree-patching migration

mithril-helpers's Introduction

mithril-helpers

Just a collection of Mithril helpers. Each helper features two variants: .js for a CommonJS + global bundle targeting a baseline of ES5.1 and .mjs for an ES module targeting a baseline of ES6, and they all feature TypeScript definitions alongside them. The index.js file specifically targets CommonJS only. No direct support for AMD/RequireJS loaders exist.

Installation

npm install --save isiahmeadows/mithril-helpers --save-exact
yarn add git+https://github.com/isiahmeadows/mithril-helpers --exact

Note: you must depend on exact Git hashes, since this package is completely unversioned, and could change in breaking ways at any point. (For similar reasons, the package version will remain at 0.0.0.) When upgrading, you should assess the diff for each file you use, to see if they require any special migration or not.

API

See here.

Issues/Contributing

If you come up with any other things that you feel should be included, or you find a bug in something I did, please file an issue, and I'll consider the use case. In particular, I could use some assistance with ensuring the stuff in /migrate actually works, so if you find bugs in it, please tell me right away, and I'll address it.

If you want to implement something yourself, definitely go for it and send a PR. Just note the following (for legal reasons): when you submit a pull request, you agree to license your contribution under the relevant license(s) in this repository, and you also agree that you have sufficient rights to do so.

Also, make sure that if you want to add a helper, your helpers should do one thing and one thing only. They should be almost zero-cost to add to a project, and ideally they shouldn't even depend on other helpers.

License

All the source code here is licensed under Blue Oak Model License 1.0.0 except for the /migrate modules, whose licenses are specified in those files (at the time of writing, it's a single file licensed MIT). Feel free to use it however you wish (within these restrictions, of course). The documentation is licensed under CC-BY 4.0 unless otherwise specified.

See here for precise details on the licenses for each as well as their legal texts.

mithril-helpers's People

Contributors

dead-claudia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mithril-helpers's Issues

self-sufficient(Component) does not send remove to it's children. HELP~

Hi`` isiahmeadows.

I'm using self-sufficient to create independant components. Somehow I found my components were not receiving onremove hook calls. Here is the example.

https://jsfiddle.net/1zfsp8jb/2/

When I hit Close(R) button, I'm expecting "comp remove"->“my button remove”->"msf remove" . However, "my button remove" never comes out. So... what should i do to get those hook calls, or am i getting wrong with the concept of mithril(and self-sufficient). Please help. Thanks. (I'm new to mithril and not very familiar.)

self-sufficient.js line 120, inst?

Hi, isiahmeadows.

Thank a lot for your last help, everything works fine, but today i came to this line.

line 120. insts.push(inst)

there is no inst here. "Uncaught ReferenceError: inst is not defined"..

= =b.. Need help again. (I tried to replace with this.. but another error happens. )

It seems to occur when delete one component from a list of components with key, in which each component is a self-sufficient, and the whole list of components are inside another self-sufficient.

Self-sufficient.js might have tiny spell error?

Oh, dear isiahmeadows..

I found self-sufficient just solves my problem. Therefore in line 75 of self-sufficient.js, cancelAnimationframe, is it to be cancelAnimationFrame? 

By the way, about efficiency, I wondor how many SelfSufficient components should be used. For example, I'd like to create a list of ToolPanel. which varies in size(say about 50+). And each panel might have its toolsets which can also be complex. The whole thing is much the same as the toolpanels of photoshop. So, in this sinario, should i create SelfSufficient components for EACH toolpanel, Or just One SelfSufficient as root of the ToolPanels?

My English is not good, so sorry for the inconvenience.

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.