1.0.393 • Published 23 days ago

@entropik/decode-survey-packages v1.0.393

Weekly downloads
-
License
MIT
Repository
github
Last release
23 days ago

decode-survey-packages

Dynamic decode survey packages

NPM JavaScript Style Guide

Install

npm install --save decode-survey-packages

How to setup

use node version 14.15.1

- create file .env at root level with following content `SKIP_PREFLIGHT_CHECK=true`
- npm install
- npm start
- cd /example
- create file .env at with following content `SKIP_PREFLIGHT_CHECK=true`
- npm install
- npm start

Do's and Dont's

  • Don't introduce state in render components i.e. components starting with Render. Render components are abstracted out strictly for render logic.
  • Don't add useEffect in render components either for the reasons mention above.
  • Create a top level component for each question type.
  • The top level component should be used for one question type only. This top level component will be imported by user to add a question type. For example, a component called Type1Question should be exported for QuestionType1 only. For QuestionTypes2, QuestionType3, create component Type2Question, Type3Question and so on. Introduce layers of components at lower level to handle the common logic.
  • Keep the state at a high level component (at single place for a question type) instead of breaking it down to smaller component. We may need it to create payload and pass it to getJsonData()
  • Use consistent naming pattern for components and filenames.
  • If there is stateful logic common accross multiple question types extract it out in a custom hook.
  • Your code is your first level of documentation, add appropriate variable name and function names. Add comments wherever required.
  • Define appropriate interfaces and types whereever required, don't abuse any.
  • Use BEM for classnames
  • Keep the code clean.
    • Don't leave commented code.
    • Fix errors and warnings before merging it to master.

Usage

check /example 
for the usage of each question types

License

MIT © ajit-kumar-Converz

1.0.393

23 days ago

1.0.392

25 days ago

1.0.391

29 days ago

1.0.389

1 month ago

1.0.390

30 days ago

1.0.388

1 month ago

1.0.387

2 months ago

1.0.386

2 months ago

1.0.385

2 months ago

1.0.384

2 months ago

1.0.382

2 months ago

1.0.380

3 months ago

1.0.378

3 months ago

1.0.377

3 months ago

1.0.379

3 months ago

1.0.376

3 months ago

1.0.375

3 months ago

1.0.374

3 months ago

1.0.373

3 months ago

1.0.372

3 months ago

1.0.370

3 months ago

1.0.371

3 months ago

1.0.369

3 months ago

1.0.368

3 months ago

1.0.365

3 months ago

1.0.364

3 months ago

1.0.367

3 months ago

1.0.363

3 months ago

1.0.361

4 months ago

1.0.360

4 months ago

1.0.359

4 months ago

1.0.358

4 months ago

1.0.357

5 months ago

1.0.356

6 months ago

1.0.355

6 months ago

1.0.354

6 months ago

1.0.353

6 months ago

1.0.349

7 months ago

1.0.348

7 months ago

1.0.347

7 months ago