New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ferrugemjs

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ferrugemjs

A reactive library.

  • 0.0.4
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

FerrugemJS

###A simple library, reactive, conventional and non-intrusive!

#####install jspm install npm:ferrugemjs

#####how start in your index.html file

  <body>    
    <div app></div>
    <script>
      System.import("ferrugemjs");
    </script>
  </body>

###conventional FerrugemJS will look for the first page element with the attribute "app" to boot and if you encounter will not use the tag "body". Just create app.js files and app.html in the same directory of the index.html page. If you want to modify the path of the file app.js just add this information to the app attribute as below:

<div app="other_path/other_init_app_file"></div>

###non-intrusive your app.js file.

class MyBasicApp{
    constructor(){
      this.title = "ferrugemjs";
    }
}
export default MyBasicApp;

Yes, without any interference from the library. Its simple class using only "javascript 2015".

###simple your app.html file.

<template args="$controller">
    <h1>My First APP with {$controller.title}</h1>
</template>

###reactive

class MyBasicApp{
    constructor(){
      this.title = "ferrugemjs";
    }
    attached(){
      setTimeout(()=>{
        this.title = "change by a settimeout";
        //a reactive update after a time
        this.refresh();//using the "refresh" method, the only injectable method by the library.
      },4000);
    }
}
export default MyBasicApp;

###importing other modules create your second module in file "hello-world.js"

class HelloWorld{
  constructor(){
    this.name = "";
  }
  //by convention as the "name" attribute is modified the method to "on" + "attribute name" + "Changed" is called.
  onNameChanged(new_name,old_name){
    this.refresh();
  }
}
export default HelloWorld;

create your second html module in file "hello-world.html"

<template args="$controller">
  <h2>Hello World, {$controller.name}</h2>
</template>

import the hello-word modulo into your app.html

<template args="$controller">
    <h1>My First APP with {$controller.title}</h1>
    <require from="hello-world"></require>
    <hello-world name="C-3PO"></hello-world>   
</template>

you can also give an alias for your module.

<template args="$controller">
    <h1>My First APP with {$controller.title}</h1>
    <require from="hello-world as sea-bienvenido"></require>
    <sea-bienvenido name="C-3PO"></sea-bienvenido>   
</template>

###module lifecycle

#####constructor: The natural way in which the object is created in javascript. #####attached: By implementing the method your module will be prompted for it once the html is in "DOM". #####on+attribute name+Changed:By implementing the method with the module attribute in CamelCase format your module will be notified when there is any change to the way template attribute

FAQs

Package last updated on 17 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc