How to use dotnetify - 10 common examples

To help you get started, we’ve selected a few dotnetify 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 dsuryd / dotNetify / DevApp / client / app / views / examples / react / SimpleList.js View on Github external
constructor(props) {
    super(props);
    this.state = { Employees: [], newName: '' };

    // Connect this component to the back-end view model.
    this.vm = dotnetify.react.connect('SimpleListVM', this);

    // Set up function to dispatch state to the back-end.
    this.dispatch = state => this.vm.$dispatch(state);

    this.dispatchState = state => {
      this.setState(state);
      this.vm.$dispatch(state);
    };
  }
github dsuryd / dotNetify / DevApp / client / app / views / examples / react / HelloWorld.js View on Github external
constructor(props) {
    super(props);
    this.state = { FirstName: '', LastName: '' };

    // Connect this component to the back-end view model.
    this.vm = dotnetify.react.connect('HelloWorldVM', this);

    // Set up function to dispatch state to the back-end.
    this.dispatchState = state => this.vm.$dispatch(state);
  }
github dsuryd / dotNetify-Elements / DevApp / src / dotnetify-elements / _internal / VMContextStore.js View on Github external
removeOrphan(vmId) {
      // Clear any existing connection to the same view model.
      dotnetify.react.getViewModels().filter(vm => vm.$vmId === vmId).forEach(vm => vm.$destroy());
   }
}
github dsuryd / dotNetify / Demo / Vue / SPA / client / index.js View on Github external
import dotnetify from 'dotnetify/vue';
import App from './App.vue';
import SimpleList from './SimpleList.vue';
import LiveChart from './LiveChart.vue';

dotnetify.debug = true;

// Set the components to global window to make it accessible to dotNetify routing.
Object.assign(window, { SimpleList, LiveChart });

dotnetify.vue.router.$mount('#App', App);
github dsuryd / dotNetify / Demo / React / SPA / client / index.js View on Github external
import React from 'react';
import dotnetify from 'dotnetify';
import ReactDOM from 'react-dom';
import App from './App';
import SimpleList from './SimpleList';
import LiveChart from './LiveChart';
import CompositeView from './CompositeView';

dotnetify.debug = true;

// Set the components to global window to make it accessible to dotNetify routing.
Object.assign(window, { SimpleList, LiveChart, CompositeView });

ReactDOM.render(, document.getElementById('App'));
github dsuryd / dotNetify-Elements / Templates / SPA / client / main.js View on Github external
import React from 'react';
import ReactDOM from 'react-dom';
import dotnetify from 'dotnetify';
import App from './App';
import Dashboard from './dashboard/Dashboard';
import Form from './form/Form';
import 'dotnetify-elements/dotnetify-elements.css';

dotnetify.debug = true;

// Import all the routeable views into the global window variable.
Object.assign(window, { Form, Dashboard });

ReactDOM.render(, document.getElementById('App'));
github dsuryd / dotNetify / DevApp / client / main.js View on Github external
import React from 'react';
import ReactDOM from 'react-dom';
import dotnetify from 'dotnetify';
import App from './app/views/App';
import './app/styles/app.css';
import './app/styles/prism.css';
import * as views from './app/views';
import 'dotnetify-elements/dotnetify-elements.css';

dotnetify.debug = true;

// Import all the routeable views into the global window variable.
Object.assign(window, { ...views });

ReactDOM.render(, document.getElementById('App'));
github dsuryd / dotNetify / _experimental / Mfe / App1 / client / main.js View on Github external
import dotnetify from 'dotnetify';
import App from './App';
import Dashboard from './dashboard/Dashboard';
import Form from './form/Form';
import createWebComponent from './utils/web-component';

dotnetify.debug = true;

// Import all the routeable views into the global window variable.
Object.assign(window, { Form, Dashboard });

createWebComponent(App, 'd-app1');
github dsuryd / dotNetify / Demo / React / SPA / client / SimpleList.js View on Github external
export default () => {
  const [ newName, setNewName ] = useState('');

  // Connect this component to the back-end view model.
  const { vm, state } = useConnect('SimpleListVM', { Employees: [] });

  // Set up function to dispatch state to the back-end.
  const dispatch = state => vm.$dispatch(state);

  return (
    
      <header>
        <span>Add:</span>
         setNewName(value)}
          onUpdate={value =&gt; {
            dispatch({ Add: value });
            setNewName('');
          }}</header>
github dsuryd / dotnetify-react-demo / ElectronHelloWorld / renderer.js View on Github external
// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.

import React from 'react'
import ReactDOM from 'react-dom'
import HelloWorld from './HelloWorld.jsx'
import dotnetify from 'dotnetify';

dotnetify.hubServerUrl = "http://localhost:5000";

ReactDOM.render(, document.getElementById('Content'))