Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alias fn for getEventData #639

Merged
merged 10 commits into from
Jul 12, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions client/luigi-client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ export type getToken = () => AuthData['accessToken'];
export function getEventData(): Context;
export type getEventData = () => Context;

/**
* Returns the context object. It invokes the getEventData() function.
JohannesDoberer marked this conversation as resolved.
Show resolved Hide resolved
* @returns {Object} current context data.
* @memberof Lifecycle
*/
export function getContext(): Context;
export type getContext = () => Context;

/**
* Returns the node parameters of the active URL.
* Node parameters are defined like URL query parameters but with a specific prefix allowing Luigi to pass them to the micro front-end view. The default prefix is **~** and you can use it in the following way: `https://my.luigi.app/home/products?~sort=asc~page=3`.
Expand Down
8 changes: 8 additions & 0 deletions client/src/lifecycleManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ class LifecycleManager extends LuigiClientBase {
getEventData() {
return this.currentContext.context;
}
/**
* Returns the context object. It invokes the getEventData() function.
* @returns {Object} current context data
* @memberof Lifecycle
*/
getContext() {
return this.getEventData();
}
/**
* Returns the node parameters of the active URL.
* Node parameters are defined like URL query parameters but with a specific prefix allowing Luigi to pass them to the micro front-end view. The default prefix is **~** and you can use it in the following way: `https://my.luigi.app/home/products?~sort=asc~page=3`.
Expand Down
3 changes: 3 additions & 0 deletions client/src/luigi-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class LuigiClient {
getEventData() {
return lifecycleManager.getEventData();
}
getContext() {
return lifecycleManager.getContext();
}
getNodeParams() {
return lifecycleManager.getNodeParams();
}
Expand Down
6 changes: 6 additions & 0 deletions docs/luigi-client-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ Returns the context object. Typically it is not required as the [addContextUpdat

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data

### getContext

Returns the context object. It invokes the getEventData() function.

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** current context data

### getNodeParams

Returns the node parameters of the active URL.
Expand Down