0.5.8 • Published 2 days ago

@unbxd-ui/unbxd-search-core v0.5.8

Weekly downloads
8
License
ISC
Repository
github
Last release
2 days ago

search-JS-core

Core library for Search JS

Getting started

this library is the dependancy for search-JS-library and react-search-JS-SDK, provides the api for interacting with search api.

Prerequisites

Install npm

Setting Up

  • use node 14.15.0

Install the npm packages & start the dev server using following commands

npm install
npm run start

ES6

Install @unbxd-ui/unbxd-search-core using npm.

npm install @unbxd-ui/unbxd-search-core --save

Import the UnbxdSearchCore function in your project

import  UnbxdSearchCore  from  "@unbxd-ui/unbxd-search-core";
            /** If opening redirect in new tab (rare scenario), 
             * then browser back + history push on search should be handled by client 
             * (especially switching betsween category to search page scenarios)
             * Note: This is not recommended */                                                       
        }
        return false;
    }
},
onBackFromRedirect: (hashMode) => {
    let urlSearchParam = new URLSearchParams(hashMode ? location.hash.substring(1) : location.search);
    let backFromRedirect = urlSearchParam.get("redirected");
    if(backFromRedirect) {
        history.go(-1);
    }
},
      onNoUnbxdKeyRouting:() => {
            history.go();
      },
      
        setRoutingStrategies:(locationParam, newUrl, productType, isUnbxdKey, replace) => {
            if (locationParam === newUrl) {
                return;
            } else if (productType === "CATEGORY") {
                /** Do not navigate to base category page  */
                if (!isUnbxdKey) {
                    history.replaceState(null, "", newUrl);
                } else {
                    history.pushState(null, "", newUrl);
                }
            } else {
                if ((history.state && history.state.replace) || replace) {
                    history.replaceState(null, "", newUrl);
                } else {
                    history.pushState(null, "", newUrl);
                }
            }
        }
  });

SDK Apis

The available apis are listed here.

0.5.8

2 days ago

0.5.7

2 months ago

0.5.6

4 months ago

0.5.5

4 months ago

0.5.4

5 months ago

0.4.35

9 months ago

0.5.3

5 months ago

0.5.0

8 months ago

0.5.2

5 months ago

0.5.1

6 months ago

0.4.33

12 months ago

0.4.34

11 months ago

0.4.32

12 months ago

0.4.31

1 year ago

0.4.30

1 year ago

0.4.28

1 year ago

0.4.29

1 year ago

0.4.27

1 year ago

0.4.26

1 year ago

0.4.24

1 year ago

0.4.25

1 year ago

0.4.23

1 year ago

0.4.22

1 year ago

0.4.23-beta.1

1 year ago

0.4.22-beta.4

1 year ago

0.4.22-beta.3

1 year ago

0.4.22-beta.2

1 year ago

0.4.22-beta.1

1 year ago

0.4.20

2 years ago

0.4.21

2 years ago

0.4.19

2 years ago

0.4.17

2 years ago

0.4.18

2 years ago

0.4.15

2 years ago

0.4.16

2 years ago

0.4.13

2 years ago

0.4.14

2 years ago

0.4.11

2 years ago

0.4.12

2 years ago

0.4.9

2 years ago

0.4.10

2 years ago

0.4.8

2 years ago

0.4.7

2 years ago

0.4.5

2 years ago

0.4.6

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.9

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.2

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago