0.0.5 • Published 4 years ago

@zohodesk/formy v0.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

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: ƒ ()   
   
0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago