How to use the inferno.linkEvent function in inferno

To help you get started, we’ve selected a few inferno examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github infernojs / inferno / packages / inferno / __tests__ / patching.spec.jsx View on Github external
it('Should change from LinkEvent to Function', () => {
        const data = { foo: 1 };
        const linkObj = {
          methodFn() {}
        };
        spyOn(linkObj, 'methodFn');

        render(<div>, container);

        expect(linkObj.methodFn).toHaveBeenCalledTimes(0);

        container.firstChild.click();

        expect(linkObj.methodFn).toHaveBeenCalledTimes(1);

        const anotherObj = {
          anotherFn() {}
        };
        spyOn(anotherObj, 'anotherFn');

        render(<div>, container);

        expect(anotherObj.anotherFn).toHaveBeenCalledTimes(0);
</div></div>
github infernojs / inferno / packages / inferno-create-element / __tests__ / linkEvent.spec.jsx View on Github external
it('Should not fail when given event is invalid', () =&gt; {
      render(<div>, container);
      container.firstChild.click();
      render(<div>, container);
      container.firstChild.click();
      render(<div>, container);
      container.firstChild.click();
      render(<div>, container);
      container.firstChild.click();
      render(<div>, container);
      container.firstChild.click();
    });
  });</div></div></div></div></div>
github infernojs / inferno / packages / inferno / __tests__ / patching.spec.jsx View on Github external
};

        spyOn(anotherObj, 'anotherFn').and.callThrough();

        render(<div>, container);

        expect(anotherObj.anotherFn).toHaveBeenCalledTimes(0);

        container.firstChild.click();

        expect(anotherObj.anotherFn).toHaveBeenCalledTimes(1);
        expect(anotherObj.anotherFn).toHaveBeenCalledWith(obj1, secondArg);

        anotherObj.anotherFn.calls.reset();

        render(<div>, container);

        expect(anotherObj.anotherFn).toHaveBeenCalledTimes(0);

        container.firstChild.click();

        expect(anotherObj.anotherFn).toHaveBeenCalledTimes(1);
        expect(anotherObj.anotherFn).toHaveBeenCalledWith(obj2, secondArg);
      });
    });</div></div>
github infernojs / inferno-website / src / components / Benchmarks.js View on Github external
{this.state.list.map((item, index) =&gt; {
              return <li>
                <span>{item.name}</span>
              </li>;
            })}
github slupjs / slup / packages / Site / src / components / nav.tsx View on Github external
return(
      <div>
        {/** The page's header */}
        <header style="{">

        {/** Sidenav */}
        
      </header></div>
    )
  }
}
github anticensority / runet-censorship-bypass / extensions / chromium / runet-censorship-bypass / src / extension-common / pages / options / src / components / Main.js View on Github external
render(props) {

      const applyModsEl = createElement(ApplyMods, Object.assign({}, props,
        {
          ifInputsDisabled: !this.state.ifModsChangesAreStashed || props.ifInputsDisabled,
          onClick: linkEvent(this, this.handleModApply),
        }
      ));

      const modsHandlers = {
        onConfChanged: this.handleModChange,
      };

      return createElement(TabPanel, Object.assign({}, props, {
        tabs: [
          {
            label: chrome.i18n.getMessage('PAC_script'),
            content: createElement(PacChooser, props),
            key: 'pacScript',
          },
          {
            label: chrome.i18n.getMessage('Exceptions'),
github infernojs / inferno / docs / uibench-normalization / app.js View on Github external
function TableCell({children}) {

  /*
   * The carbage code is intentional
   */
  return (
    
      {null}
      {false}
      {[children]}
    
  );
}
github slupjs / slup / packages / Site / src / pages / home.tsx View on Github external
export default (props: Object, { router }) =&gt;
  
    
      

      
        Lighting-fast, highly customizable and flexible <a href="https://infernojs.org/">Inferno</a> components<br>
        that strictly follow <a href="https://material.io/guidelines/">Material Design</a> guidelines
      

      
        Get started
github krausest / js-framework-benchmark / inferno-v3.10.1-keyed / src / controller.jsx View on Github external
function Row({ d, id, selected, deleteFunc, selectFunc }) {
    return (
        
            {id + ''}
            
                <a>{d.label}</a>
            
            <a>{ span }</a>
            { td }
        
    )
}
github infernojs / inferno-website / src / components / common / ContentAccordion.js View on Github external
{this.state.list.map((item, index) =&gt; {
            return <li>
              <a>
                {item.name}
              </a>
            </li>;
          })}