2.0.4 • Published 2 years ago

@asurraa/sura-ui-async-mask-components v2.0.4

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Sura Async Mask Components

use to wrap async function for a query fetcher like category from id.

user case

  • use with table components + binding with sura-fetcher
  const {
    getOnePromise: getOneProductCategory,
    getAll: getAllCategory,
    getOne: getOneProductCategoryCache,
  } = useProductCategoryService();
const column:AsurRaaColumnsProps<TProductService>[] = [{
    {
      dataIndex: "category_id",
      title: "Category",
      width: "100px",
      render: (value, props) => {
        return (
          <SuraAsyncMaskComponents
            queryCache={["name"]}
            fetcher={getOneProductCategoryCache({ id: props.category_id })}
            render={(value, loading) => {
              return <Tag>{value}</Tag>;
            }}
          />
        );
      },
    },
}]
2.0.4

2 years ago

2.0.2

3 years ago

1.0.7

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago