Sudoo-Title

Continuous Integration codecov npm version downloads

Title Chain

Install

yarn add @sudoo/title
# Or
npm install @sudoo/title --save

Usage

import { Title } from "@sudoo/title";

const title: Title = Title.create("MyIndex");

// Options: On page init (EX: index component did mount)
title.restoreTitle(); // Title > "MyIndex"

// On page changes (EX: page component did mount)
title.setTitle("SubPageTitle"); // Title > "SubPageTitle"

// On page restored (EX: page component did unmount)
title.restoreTitle(); // Title > "MyIndex"