@zohodesk/formy

0.0.5 • Public • Published

Reducer

import { combineReducers } from 'redux'
import { createFormReducer, formStoreName } from '@zohodesk/formy'

const formReducer = createFormReducer();

combineReducers({

   [ formStoreName ] : formReducer,
    ...
    ...
    ...
});

Container/Component

import React, { Component } from 'react';
import { ConnectedForm, setupForm, formReady } from "@zohodesk/formy";

const dummyFormId = "dummyForm";
const DummyForm=({actions,readers})=>{
    
        return null;
}

class DummyFormContainer extends Component{
    
    componentDidMount() {
    
            this.props.dispatch(setupForm({
                formId : dummyFormId,
                layoutFields :{
  
                    fields : [
                        {
                            id: "9837454735",
                            apiName : "subject",
                            value : ''
                        },
                        {
                            id: "89345834535",
                            apiName : "description",
                            value : ''
                        }
                    ]
    
                }
            }));
    
            this.props.dispatch(formReady({
                formId : dummyFormId
            }))
    
    }
        
    render(){
        
        return <div>
        
            <h2>Dummy Form Model</h2>
            <ConnectedForm formId={dummyFormId}>{DummyForm}</ConnectedForm>

        </div>

    }

}

export default connect(null)(DummyFormContainer);

   actions.
       deleteForm: ƒ ()
       resetForm: ƒ ()
       setFieldData: ƒ ()
       submitForm: ƒ ()
       validateForm: ƒ ()
        
   readers.
       getField: ƒ ()
       getFields: ƒ ()
       getLayout: ƒ ()
       getLayouts: ƒ ()
       getSection: ƒ ()
       getSections: ƒ ()   
   

Readme

Keywords

none

Package Sidebar

Install

npm i @zohodesk/formy

Weekly Downloads

1

Version

0.0.5

License

ISC

Unpacked Size

931 kB

Total Files

200

Last publish

Collaborators

  • ganeshkumar.m
  • iniankarthick
  • subashree
  • jesinth
  • lingam
  • sudalaimuthu
  • johnson_raavanan
  • kumaresanm